feature/use-case-acceptance-tests-2 #117
@ -194,7 +194,6 @@ class HsOfficeScenarioTests extends ScenarioTest {
|
||||
@Requires("SEPA-Mandate: Test AG")
|
||||
void shouldInvalidateSepaMandateForDebitor() {
|
||||
new InvalidateSepaMandateForDebitor(this)
|
||||
.given("debitorNumberNumber", "31010")
|
||||
.given("bankAccountIBAN", "DE02701500000000594937")
|
||||
.given("mandateValidUntil", "2025-09-30")
|
||||
.doRun();
|
||||
|
@ -15,9 +15,16 @@ public class InvalidateSepaMandateForDebitor extends UseCase<InvalidateSepaManda
|
||||
@Override
|
||||
protected HttpResponse run() {
|
||||
|
||||
return httpPatch("/api/hs/office/sepamandates/" + uuid("SEPA-Mandate: Test AG"), usingJsonBody("""
|
||||
obtain("SEPA-Mandate: %{bankAccountIBAN}", () ->
|
||||
httpGet("/api/hs/office/sepamandates?iban=&{bankAccountIBAN}")
|
||||
.expecting(OK).expecting(JSON),
|
||||
response -> response.expectArrayElements(1).getFromBody("[0].uuid"),
|
||||
"With production data, the bank-account could be used in multiple SEPA-mandates, make sure to use the right one!"
|
||||
);
|
||||
|
||||
return httpPatch("/api/hs/office/sepamandates/&{SEPA-Mandate: %{bankAccountIBAN}}", usingJsonBody("""
|
||||
{
|
||||
"validUntil": ${validUntil}
|
||||
"validUntil": ${mandateValidUntil}
|
||||
}
|
||||
"""))
|
||||
.expecting(OK).expecting(JSON);
|
||||
|
Loading…
Reference in New Issue
Block a user