use-case-test for create membership

This commit is contained in:
Michael Hoennig 2024-10-15 16:04:29 +02:00
parent 963bf89841
commit dffe838aa6
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package net.hostsharing.hsadminng.hs.office.usecases;
import org.springframework.http.HttpStatus;
import static io.restassured.http.Method.POST;
class HsOfficeMembershipUseCase extends UseCase {
public HsOfficeMembershipUseCase(final UseCaseTest testSuite) {
super(testSuite);
}
void shouldCreateMembershipForPartner() {
http(POST, "/api/hs/office/memberships", usingJsonBody("""
{
"partnerUuid": "${partner:Test AG.uuid}",
"memberNumberSuffix": "00",
"validFrom": "2024-10-15",
"membershipFeeBillable": "true"
}
"""))
.expecting(HttpStatus.CREATED)
.keepingAs("membership:Test AG 00.uuid");
}
}

View File

@ -28,4 +28,10 @@ class HsOfficeUseCasesTest extends UseCaseTest {
void shouldCreateSelfDebitorForPartner() { void shouldCreateSelfDebitorForPartner() {
new HsOfficeDebitorUseCase(this).shouldCreateSelfDebitorForPartner(); new HsOfficeDebitorUseCase(this).shouldCreateSelfDebitorForPartner();
} }
@Test
@Order(1030)
void shouldCreateMembershipForPartner() {
new HsOfficeMembershipUseCase(this).shouldCreateMembershipForPartner();
}
} }