add department to contact.postalAddress test data (#192)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/192 Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
-1
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@WebMvcTest(controllers = RestResponseEntityExceptionHandlerRestTest.TestController.class)
|
||||
|
||||
+28
-3
@@ -3,6 +3,9 @@ package net.hostsharing.hsadminng.hs.office.contact;
|
||||
import net.hostsharing.hsadminng.rbac.generator.RbacViewMermaidFlowchartGenerator;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static java.util.Map.entry;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class HsOfficeContactUnitTest {
|
||||
@@ -14,9 +17,31 @@ class HsOfficeContactUnitTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void toStringReturnsCaption() {
|
||||
final var givenContact = HsOfficeContactRbacEntity.builder().caption("given caption").build();
|
||||
assertThat("" + givenContact).isEqualTo("contact(caption='given caption')");
|
||||
void toStringDescribesAllDomainProperties() {
|
||||
final var givenContact = HsOfficeContactRbacEntity.builder()
|
||||
.caption("given caption")
|
||||
.postalAddress(Map.ofEntries(
|
||||
entry("department", "Rechnungsabteilung"),
|
||||
entry("street", "Teststraße 11"),
|
||||
entry("zipcode", "D-12345"),
|
||||
entry("city", "Berlin")
|
||||
))
|
||||
.emailAddresses(Map.ofEntries(
|
||||
Map.entry("main", "main@example.org"),
|
||||
Map.entry("sender", "sender@example.org")
|
||||
))
|
||||
.build();
|
||||
assertThat("" + givenContact).isEqualTo("""
|
||||
contact(caption='given caption', postalAddress='{
|
||||
"city" : "Berlin",
|
||||
"department" : "Rechnungsabteilung",
|
||||
"street" : "Teststraße 11",
|
||||
"zipcode" : "D-12345"
|
||||
}', emailAddresses='{
|
||||
"main" : "main@example.org",
|
||||
"sender" : "sender@example.org"
|
||||
}')
|
||||
""".trim());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
-2
@@ -119,6 +119,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
|
||||
.given(
|
||||
"postalAddress", """
|
||||
"firm": "Test AG",
|
||||
"department": "Geschäftsleitung",
|
||||
"street": "Shanghai-Allee 1",
|
||||
"zipcode": "20123",
|
||||
"city": "Hamburg",
|
||||
@@ -261,8 +262,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
|
||||
.given("newContactCaption", "Test AG - China")
|
||||
.given(
|
||||
"newPostalAddress", """
|
||||
"firm": "Test AG",
|
||||
"name": "Fi Zhong-Kha",
|
||||
"department": "Executive Board",
|
||||
"building": "Thi Chi Koh Building",
|
||||
"street": "No.2 Commercial Second Street",
|
||||
"district": "Niushan Wei Wu",
|
||||
|
||||
Reference in New Issue
Block a user