feature/use-case-acceptance-tests #116

Merged
hsh-michaelhoennig merged 49 commits from feature/use-case-acceptance-tests into master 2024-10-30 11:40:46 +01:00
6 changed files with 15 additions and 51 deletions
Showing only changes of commit 6817219553 - Show all commits

View File

@ -172,7 +172,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
@Requires("Debitor: Test AG - main debitor") @Requires("Debitor: Test AG - main debitor")
@Produces("SEPA-Mandate: Test AG") @Produces("SEPA-Mandate: Test AG")
void shouldCreateSepaMandateForDebitor() { void shouldCreateSepaMandateForDebitor() {
new CreateSepaMandataForDebitor(this) new CreateSepaMandateForDebitor(this)
.given("debitor", "Test AG") .given("debitor", "Test AG")
.given("memberNumberSuffix", "00") .given("memberNumberSuffix", "00")
.given("validFrom", "2024-10-15") .given("validFrom", "2024-10-15")
@ -195,7 +195,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
@Order(3109) @Order(3109)
@Requires("SEPA-Mandate: Test AG") @Requires("SEPA-Mandate: Test AG")
void shouldDeleteSepaMandateForDebitor() { void shouldDeleteSepaMandateForDebitor() {
new DeleteSepaMandataForDebitor(this) new DeleteSepaMandateForDebitor(this)
.given("sepaMandateUuid", "%{SEPA-Mandate: Test AG}") .given("sepaMandateUuid", "%{SEPA-Mandate: Test AG}")
.doRun(); .doRun();
} }

View File

@ -1,34 +0,0 @@
package net.hostsharing.hsadminng.hs.office.scenarios;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
import java.util.function.Consumer;
public class MethodReferenceExample {
public static void myMethod(String input) {
System.out.println("Hello from myMethod, input: " + input);
}
public static void main(String[] args) {
// Create a method reference
Consumer<String> methodRef = MethodReferenceExample::myMethod;
// Use reflection to retrieve method reference info
try {
// Step 1: Get the method 'writeReplace' via reflection
Method writeReplace = methodRef.getClass().getDeclaredMethod("writeReplace");
writeReplace.setAccessible(true);
// Step 2: Invoke 'writeReplace' to get a SerializedLambda
SerializedLambda serializedLambda = (SerializedLambda) writeReplace.invoke(methodRef);
// Step 3: Get the method name using the SerializedLambda
String methodName = serializedLambda.getImplMethodName();
System.out.println("Original method name: " + methodName);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -86,7 +86,6 @@ public class TemplateResolver {
throw new IllegalStateException("no more characters. resolved so far: " + resolved); throw new IllegalStateException("no more characters. resolved so far: " + resolved);
} }
final var currentChar = currentChar(); final var currentChar = currentChar();
//System.out.println("fetched #" + position + ": " + currentChar);
++position; ++position;
return currentChar; return currentChar;
} }

View File

@ -6,9 +6,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest;
import static io.restassured.http.ContentType.JSON; import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.CREATED; import static org.springframework.http.HttpStatus.CREATED;
public class CreateSepaMandataForDebitor extends UseCase<CreateSepaMandataForDebitor> { public class CreateSepaMandateForDebitor extends UseCase<CreateSepaMandateForDebitor> {
public CreateSepaMandataForDebitor(final ScenarioTest testSuite) { public CreateSepaMandateForDebitor(final ScenarioTest testSuite) {
super(testSuite); super(testSuite);
} }

View File

@ -5,9 +5,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
public class DeleteSepaMandataForDebitor extends UseCase<DeleteSepaMandataForDebitor> { public class DeleteSepaMandateForDebitor extends UseCase<DeleteSepaMandateForDebitor> {
public DeleteSepaMandataForDebitor(final ScenarioTest testSuite) { public DeleteSepaMandateForDebitor(final ScenarioTest testSuite) {
super(testSuite); super(testSuite);
} }

View File

@ -25,16 +25,15 @@ public class AddOperationsContactToPartner extends UseCase<AddOperationsContactT
"In production data this query could result in multiple outputs. In that case, you have to find out which is the right one." "In production data this query could result in multiple outputs. In that case, you have to find out which is the right one."
); );
obtain("Person: %{operationsContactGivenName} %{operationsContactFamilyName}", obtain("Person: %{operationsContactGivenName} %{operationsContactFamilyName}", () ->
() -> httpPost("/api/hs/office/persons", usingJsonBody("""
httpPost("/api/hs/office/persons", usingJsonBody(""" {
{ "personType": "NATURAL_PERSON",
"personType": "NATURAL_PERSON", "familyName": ${operationsContactFamilyName},
"familyName": ${operationsContactFamilyName}, "givenName": ${operationsContactGivenName}
"givenName": ${operationsContactGivenName} }
} """))
""")) .expecting(HttpStatus.CREATED).expecting(ContentType.JSON),
.expecting(HttpStatus.CREATED).expecting(ContentType.JSON),
"Please check first if that person already exists, if so, use it's UUID below.", "Please check first if that person already exists, if so, use it's UUID below.",
"**HINT**: operations contacts are always connected to a partner-person, thus a person which is a holder of a partner-relation." "**HINT**: operations contacts are always connected to a partner-person, thus a person which is a holder of a partner-relation."
); );