WIP
This commit is contained in:
parent
9f1bb284e7
commit
4712d69012
@ -9,6 +9,7 @@ import net.hostsharing.hsadminng.mapper.StrictMapper;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.validation.ValidationException;
|
||||
|
||||
// FIXME: rename to HsOfficeRelationPatcher
|
||||
public class HsOfficeRelationEntityPatcher implements EntityPatcher<HsOfficeRelationPatchResource> {
|
||||
|
||||
private final StrictMapper mapper;
|
||||
|
@ -18,6 +18,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
import jakarta.validation.ValidationException;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ -70,6 +71,9 @@ class HsOfficeRelationEntityPatcherUnitTest extends PatchUnitTestBase<
|
||||
private static HsOfficeContactRealEntity PATCHED_CONTACT = HsOfficeContactRealEntity.builder()
|
||||
.uuid(PATCHED_CONTACT_UUID)
|
||||
.caption("Patched-Contact-Caption")
|
||||
.emailAddresses(Map.ofEntries(
|
||||
Map.entry("main", "patched@exampl.org")
|
||||
))
|
||||
.build();
|
||||
|
||||
@Mock
|
||||
|
@ -20,6 +20,8 @@ import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
|
||||
// FIXME: replace with HsOfficeRelationEntityPatcherUnitTest
|
||||
|
||||
@TestInstance(PER_CLASS)
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class HsOfficeRelationPatcherUnitTest extends PatchUnitTestBase<
|
||||
|
@ -104,8 +104,14 @@ public class ReplaceDeceasedPartnerWithCommunityOfHeirs extends UseCase<ReplaceD
|
||||
"Erbengemeinschaft %{givenNameOfDeceasedPerson} %{familyNameOfDeceasedPerson}")
|
||||
);
|
||||
|
||||
// TODO.test: Verify the EX_PARTNER-Relation, once we fixed the anchor problem, see HsOfficePartnerController
|
||||
// (net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerController.optionallyCreateExPartnerRelation)
|
||||
verify(
|
||||
"Verify the Ex-Partner-Relation",
|
||||
() -> httpGet(
|
||||
"/api/hs/office/relations?relationType=EX_PARTNER&personUuid=%{Person: %{givenNameOfDeceasedPerson} %{familyNameOfDeceasedPerson}}")
|
||||
.expecting(OK).expecting(JSON).expectArrayElements(1),
|
||||
path("[0].anchor.tradeName").contains(
|
||||
"Erbengemeinschaft %{givenNameOfDeceasedPerson} %{familyNameOfDeceasedPerson}")
|
||||
);
|
||||
|
||||
verify(
|
||||
"Verify the Representative-Relation",
|
||||
@ -117,6 +123,16 @@ public class ReplaceDeceasedPartnerWithCommunityOfHeirs extends UseCase<ReplaceD
|
||||
path("[0].holder.familyName").contains("%{representativeFamilyName}")
|
||||
);
|
||||
|
||||
// TODO.test: Verify Debitor, Membership, Coop-Shares and Coop-Assets once implemented
|
||||
|
||||
verify(
|
||||
"Verify the Debitor-Relation",
|
||||
() -> httpGet(
|
||||
"/api/hs/office/debitors?partnerNumber=%{partnerNumber}")
|
||||
.expecting(OK).expecting(JSON).expectArrayElements(1),
|
||||
path("[0].debitorRel.anchor.tradeName").contains(
|
||||
"Erbengemeinschaft %{givenNameOfDeceasedPerson} %{familyNameOfDeceasedPerson}"),
|
||||
path("[0].debitorRel.holder.tradeName").contains(
|
||||
"Erbengemeinschaft %{givenNameOfDeceasedPerson} %{familyNameOfDeceasedPerson}")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user