automatically-create-ex-partner-relation #35

Merged
hsh-michaelhoennig merged 3 commits from automatically-create-ex-partner-relation into master 2024-04-09 10:08:49 +02:00
2 changed files with 11 additions and 14 deletions
Showing only changes of commit 038d60b789 - Show all commits

View File

@ -26,6 +26,7 @@ import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Version;
import jakarta.validation.constraints.Pattern;
import java.io.IOException;
import java.util.UUID;

View File

@ -402,23 +402,19 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
.statusCode(200)
.contentType(ContentType.JSON)
.body("uuid", isUuidValid())
.body("details.birthName", is("Maja Schmidt"));
// TODO: assert partnerRel
// .body("contact.label", is(givenPartner.getContact().getLabel()))
// .body("person.tradeName", is(givenPartner.getPerson().getTradeName()));
.body("details.birthName", is("Maja Schmidt"))
.body("partnerRel.contact.label", is(givenPartner.getPartnerRel().getContact().getLabel()));
// @formatter:on
// finally, the partner is actually updated
// finally, the partner details and only the partner details are actually updated
assertThat(partnerRepo.findByUuid(givenPartner.getUuid())).isPresent().get()
.matches(person -> {
// TODO: assert partnerRel
// assertThat(person.getPerson().getTradeName()).isEqualTo(givenPartner.getPerson().getTradeName());
// assertThat(person.getContact().getLabel()).isEqualTo(givenPartner.getContact().getLabel());
assertThat(person.getDetails().getRegistrationOffice()).isEqualTo("Temp Registergericht Leer");
assertThat(person.getDetails().getRegistrationNumber()).isEqualTo("333333");
assertThat(person.getDetails().getBirthName()).isEqualTo("Maja Schmidt");
assertThat(person.getDetails().getBirthday()).isEqualTo("1938-04-08");
assertThat(person.getDetails().getDateOfDeath()).isEqualTo("2022-01-12");
.matches(partner -> {
assertThat(partner.getPartnerRel().getContact().getLabel()).isEqualTo(givenPartner.getPartnerRel().getContact().getLabel());
assertThat(partner.getDetails().getRegistrationOffice()).isEqualTo("Temp Registergericht Leer");
assertThat(partner.getDetails().getRegistrationNumber()).isEqualTo("333333");
assertThat(partner.getDetails().getBirthName()).isEqualTo("Maja Schmidt");
assertThat(partner.getDetails().getBirthday()).isEqualTo("1938-04-08");
assertThat(partner.getDetails().getDateOfDeath()).isEqualTo("2022-01-12");
return true;
});
}