From f7661b25dd8160ee06ee5314a82aec6ec95867e0 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 24 Oct 2024 13:34:20 +0200 Subject: [PATCH] add shouldRemoveOperationsContactFromPartner --- .../office/usecases/HsOfficeUseCasesTest.java | 10 ++++++++++ .../RemoveOperationsContactFromPartner.java | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/test/java/net/hostsharing/hsadminng/hs/office/usecases/subscription/RemoveOperationsContactFromPartner.java diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/HsOfficeUseCasesTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/HsOfficeUseCasesTest.java index 19943514..38dc70cd 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/HsOfficeUseCasesTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/HsOfficeUseCasesTest.java @@ -12,6 +12,7 @@ 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.partner.DeletePartner; import net.hostsharing.hsadminng.hs.office.usecases.partner.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.UnsubscribeFromMailinglist; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; @@ -78,6 +79,15 @@ class HsOfficeUseCasesTest extends UseCaseTest { .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 @Order(1090) void shouldDeletePartner() { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/subscription/RemoveOperationsContactFromPartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/subscription/RemoveOperationsContactFromPartner.java new file mode 100644 index 00000000..7e5b0888 --- /dev/null +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/subscription/RemoveOperationsContactFromPartner.java @@ -0,0 +1,20 @@ +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 { + + public RemoveOperationsContactFromPartner(final UseCaseTest testSuite) { + super(testSuite); + } + + @Override + protected HttpResponse run() { + + return httpDelete("/api/hs/office/relations/" + uuid("operationContactRelationUuid")) + .expecting(NO_CONTENT); + } +}