Compare commits

..

No commits in common. "f7661b25dd8160ee06ee5314a82aec6ec95867e0" and "49b2aec88448c9166278e75b91012a3931943e17" have entirely different histories.

4 changed files with 6 additions and 110 deletions

View File

@ -7,12 +7,10 @@ import net.hostsharing.hsadminng.hs.office.usecases.debitor.CreateSepaMandataFor
import net.hostsharing.hsadminng.hs.office.usecases.debitor.DeleteSepaMandataForDebitor; import net.hostsharing.hsadminng.hs.office.usecases.debitor.DeleteSepaMandataForDebitor;
import net.hostsharing.hsadminng.hs.office.usecases.debitor.InvalidateSepaMandateForDebitor; import net.hostsharing.hsadminng.hs.office.usecases.debitor.InvalidateSepaMandateForDebitor;
import net.hostsharing.hsadminng.hs.office.usecases.membership.CreateMembership; import net.hostsharing.hsadminng.hs.office.usecases.membership.CreateMembership;
import net.hostsharing.hsadminng.hs.office.usecases.partner.AddOperationsContactToPartner;
import net.hostsharing.hsadminng.hs.office.usecases.partner.CreatePartner; import net.hostsharing.hsadminng.hs.office.usecases.partner.CreatePartner;
import net.hostsharing.hsadminng.hs.office.usecases.debitor.DeleteDebitor; import net.hostsharing.hsadminng.hs.office.usecases.debitor.DeleteDebitor;
import net.hostsharing.hsadminng.hs.office.usecases.partner.DeletePartner; import net.hostsharing.hsadminng.hs.office.usecases.partner.DeletePartner;
import net.hostsharing.hsadminng.hs.office.usecases.partner.AddRepresentativeToPartner; import net.hostsharing.hsadminng.hs.office.usecases.subscription.AddRepresentativeToPartner;
import net.hostsharing.hsadminng.hs.office.usecases.subscription.RemoveOperationsContactFromPartner;
import net.hostsharing.hsadminng.hs.office.usecases.subscription.SubscribeToMailinglist; import net.hostsharing.hsadminng.hs.office.usecases.subscription.SubscribeToMailinglist;
import net.hostsharing.hsadminng.hs.office.usecases.subscription.UnsubscribeFromMailinglist; import net.hostsharing.hsadminng.hs.office.usecases.subscription.UnsubscribeFromMailinglist;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
@ -33,7 +31,7 @@ class HsOfficeUseCasesTest extends UseCaseTest {
@Test @Test
@Order(1010) @Order(1010)
@Produces(explicitly = "Partner: Test AG", implicitly = {"Person: Test AG", "Contact: Test AG - Board of Directors"}) @Produces(explicitly = "Partner: Test AG", implicitly = "Person: Test AG")
void shouldCreatePartner() { void shouldCreatePartner() {
new CreatePartner(this) new CreatePartner(this)
.given("partnerNumber", 31010) .given("partnerNumber", 31010)
@ -52,8 +50,8 @@ class HsOfficeUseCasesTest extends UseCaseTest {
void shouldAddRepresentativeToPartner() { void shouldAddRepresentativeToPartner() {
new AddRepresentativeToPartner(this) new AddRepresentativeToPartner(this)
.given("partnerPersonUuid", "%{Person: Test AG}") .given("partnerPersonUuid", "%{Person: Test AG}")
.given("representativeFamilyName", "Trust") .given("representativeFamilyName", "Tracy")
.given("representativeGivenName", "Tracy") .given("representativeGivenName", "Trust")
.given("representativePostalAddress", """ .given("representativePostalAddress", """
An der Alster 100 An der Alster 100
20000 Hamburg 20000 Hamburg
@ -64,30 +62,6 @@ class HsOfficeUseCasesTest extends UseCaseTest {
.keep(); .keep();
} }
@Test
@Order(1030)
@Requires("Person: Test AG")
@Produces("Operations-Contact: Dennis Krause for Test AG")
void shouldAddOperationsContactToPartner() {
new AddOperationsContactToPartner(this)
.given("partnerPersonUuid", "%{Person: Test AG}")
.given("operationsContactFamilyName", "Krause")
.given("operationsContactGivenName", "Dennis")
.given("operationsContactPhoneNumber", "+49 9932 587741")
.given("operationsContactEMailAddress", "dennis.krause@example.org")
.doRun()
.keep();
}
@Test
@Order(1039)
@Requires("Operations-Contact: Dennis Krause for Test AG")
void shouldRemoveOperationsContactFromPartner() {
new RemoveOperationsContactFromPartner(this)
.given("operationContactRelationUuid", "%{Operations-Contact: Dennis Krause for Test AG}")
.doRun();
}
@Test @Test
@Order(1090) @Order(1090)
void shouldDeletePartner() { void shouldDeletePartner() {

View File

@ -1,58 +0,0 @@
package net.hostsharing.hsadminng.hs.office.usecases.partner;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.hs.office.usecases.UseCase;
import net.hostsharing.hsadminng.hs.office.usecases.UseCaseTest;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.CREATED;
public class AddOperationsContactToPartner extends UseCase<AddOperationsContactToPartner> {
public AddOperationsContactToPartner(final UseCaseTest testSuite) {
super(testSuite);
}
@Override
protected HttpResponse run() {
keep("Person: %{operationsContactGivenName} %{operationsContactFamilyName}", () ->
httpPost("/api/hs/office/persons", usingJsonBody("""
{
"personType": "NATURAL_PERSON",
"familyName": ${operationsContactFamilyName},
"givenName": ${operationsContactGivenName}
}
"""))
.expecting(HttpStatus.CREATED).expecting(ContentType.JSON)
);
printPara("Please check first if that person already exists, if so, use it's UUID below.");
printPara("**HINT**: operations contacts are always connected to a partner-person, thus a person which is a holder of a partner-relation.");
keep("Contact: %{operationsContactGivenName} %{operationsContactFamilyName}", () ->
httpPost("/api/hs/office/contacts", usingJsonBody("""
{
"caption": "%{operationsContactGivenName} %{operationsContactFamilyName}",
"phoneNumbers": {
"main": ${operationsContactPhoneNumber}
},
"emailAddresses": {
"main": ${operationsContactEMailAddress}
}
}
"""))
.expecting(CREATED).expecting(JSON)
);
printPara("Please check first if that contact already exists, if so, use it's UUID below.");
return httpPost("/api/hs/office/relations", usingJsonBody("""
{
"type": "OPERATIONS",
"anchorUuid": ${partnerPersonUuid},
"holderUuid": ${Person: %{operationsContactGivenName} %{operationsContactFamilyName}},
"contactUuid": ${Contact: %{operationsContactGivenName} %{operationsContactFamilyName}}
}
"""))
.expecting(CREATED).expecting(JSON);
}
}

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.hs.office.usecases.partner; package net.hostsharing.hsadminng.hs.office.usecases.subscription;
import io.restassured.http.ContentType; import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.hs.office.usecases.UseCase; import net.hostsharing.hsadminng.hs.office.usecases.UseCase;
@ -27,7 +27,7 @@ public class AddRepresentativeToPartner extends UseCase<AddRepresentativeToPartn
.expecting(HttpStatus.CREATED).expecting(ContentType.JSON) .expecting(HttpStatus.CREATED).expecting(ContentType.JSON)
); );
printPara("Please check first if that person already exists, if so, use it's UUID below."); printPara("Please check first if that person already exists, if so, use it's UUID below.");
printPara("**HINT**: A representative is always a natural person and represents a non-natural-person."); print("**HINT**: A representative is always a natural person and represents a non-natural-person.");
keep("Contact: %{representativeGivenName} %{representativeFamilyName}", () -> keep("Contact: %{representativeGivenName} %{representativeFamilyName}", () ->
httpPost("/api/hs/office/contacts", usingJsonBody(""" httpPost("/api/hs/office/contacts", usingJsonBody("""

View File

@ -1,20 +0,0 @@
package net.hostsharing.hsadminng.hs.office.usecases.subscription;
import net.hostsharing.hsadminng.hs.office.usecases.UseCase;
import net.hostsharing.hsadminng.hs.office.usecases.UseCaseTest;
import static org.springframework.http.HttpStatus.NO_CONTENT;
public class RemoveOperationsContactFromPartner extends UseCase<RemoveOperationsContactFromPartner> {
public RemoveOperationsContactFromPartner(final UseCaseTest testSuite) {
super(testSuite);
}
@Override
protected HttpResponse run() {
return httpDelete("/api/hs/office/relations/" + uuid("operationContactRelationUuid"))
.expecting(NO_CONTENT);
}
}