Compare commits

..

No commits in common. "139863ea839feeed43b6130c3999938055e4e289" and "2eb1359fddd635f72e1fb47ee7146d75ed40ff55" have entirely different histories.

11 changed files with 13 additions and 52 deletions

6
Jenkinsfile vendored
View File

@ -45,11 +45,7 @@ pipeline {
sourcePattern: 'src/main/java'
)
// archive scenario-test reports in HTML format
sh '''
cd doc/scenarios
./to-html
'''
// archive scenario-test reports
archiveArtifacts artifacts: 'doc/scenarios/*.html', allowEmptyArchive: true
// cleanup workspace

View File

@ -7,7 +7,7 @@ get:
parameters:
- $ref: 'auth.yaml#/components/parameters/currentSubject'
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: iban
- name: name
in: query
required: false
schema:

View File

@ -194,6 +194,7 @@ 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();

View File

@ -24,7 +24,7 @@ public class DeleteDebitor extends UseCase<DeleteDebitor> {
@Override
protected HttpResponse run() {
httpDelete("/api/hs/office/debitors/&{Debitor: Test AG - delete debitor}")
httpDelete("/api/hs/office/debitors/" + uuid("Debitor: Test AG - delete debitor"))
.expecting(HttpStatus.NO_CONTENT);
return null;
}

View File

@ -13,7 +13,7 @@ public class DeleteSepaMandateForDebitor extends UseCase<DeleteSepaMandateForDeb
@Override
protected HttpResponse run() {
httpDelete("/api/hs/office/sepamandates/&{SEPA-Mandate: Test AG}")
httpDelete("/api/hs/office/sepamandates/" + uuid("SEPA-Mandate: Test AG"))
.expecting(HttpStatus.NO_CONTENT);
return null;
}

View File

@ -12,7 +12,7 @@ public class DontDeleteDefaultDebitor extends UseCase<DontDeleteDefaultDebitor>
@Override
protected HttpResponse run() {
httpDelete("/api/hs/office/debitors/&{Debitor: Test AG - main debitor}")
httpDelete("/api/hs/office/debitors/" + uuid("Debitor: Test AG - main debitor"))
// TODO.spec: should be CONFLICT or CLIENT_ERROR for Debitor "00" - but how to delete Partners?
.expecting(HttpStatus.NO_CONTENT);
return null;

View File

@ -15,16 +15,9 @@ public class InvalidateSepaMandateForDebitor extends UseCase<InvalidateSepaManda
@Override
protected HttpResponse run() {
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("""
return httpPatch("/api/hs/office/sepamandates/" + uuid("SEPA-Mandate: Test AG"), usingJsonBody("""
{
"validUntil": ${mandateValidUntil}
"validUntil": ${validUntil}
}
"""))
.expecting(OK).expecting(JSON);

View File

@ -18,7 +18,7 @@ public class DeletePartner extends UseCase<DeletePartner> {
@Override
protected HttpResponse run() {
httpDelete("/api/hs/office/partners/&{Partner: Delete AG}")
httpDelete("/api/hs/office/partners/" + uuid("Partner: Delete AG"))
.expecting(HttpStatus.NO_CONTENT);
return null;
}

View File

@ -23,7 +23,7 @@ public class RemoveOperationsContactFromPartner extends UseCase<RemoveOperations
"In production data this query could result in multiple outputs. In that case, you have to find out which is the right one."
);
return httpDelete("/api/hs/office/relations/&{Operations-Contact: %{operationsContactPerson}}")
return httpDelete("/api/hs/office/relations/" + uuid("Operations-Contact: %{operationsContactPerson}"))
.expecting(NO_CONTENT);
}
}

View File

@ -25,7 +25,7 @@ public class UnsubscribeFromMailinglist extends UseCase<UnsubscribeFromMailingli
"In production data this query could result in multiple outputs. In that case, you have to find out which is the right one."
);
return httpDelete("/api/hs/office/relations/&{Subscription: %{subscriberEMailAddress}}")
return httpDelete("/api/hs/office/relations/" + uuid("Subscription: %{subscriberEMailAddress}"))
.expecting(NO_CONTENT);
}
}

View File

@ -8,6 +8,7 @@ import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountReposi
import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorRepository;
import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.json.JSONException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
@ -57,7 +58,7 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl
class ListSepaMandates {
@Test
void globalAdmin_canViewAllSepaMandates_ifNoCriteriaGiven() {
void globalAdmin_canViewAllSepaMandates_ifNoCriteriaGiven() throws JSONException {
RestAssured // @formatter:off
.given()
@ -96,36 +97,6 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl
"""));
// @formatter:on
}
@Test
void globalAdmin_canFindSepaMandateByName() {
RestAssured // @formatter:off
.given()
.header("current-subject", "superuser-alex@hostsharing.net")
.port(port)
.when()
.get("http://localhost/api/hs/office/sepamandates?iban=DE02120300000000202051")
.then().log().all().assertThat()
.statusCode(200)
.contentType("application/json")
.log().all()
.body("", lenientlyEquals("""
[
{
"debitor": { "debitorNumber": 1000111 },
"bankAccount": {
"iban": "DE02120300000000202051",
"holder": "First GmbH"
},
"reference": "ref-10001-11",
"validFrom": "2022-10-01",
"validTo": "2026-12-31"
}
]
"""));
// @formatter:on
}
}
@Nested