explicitly fetch SEPA-Mandate in CreateSepaMandateForDebitor
This commit is contained in:
parent
f2733b804a
commit
82f1ec057f
@ -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