Skip to content

Commit 74acff1

Browse files
authored
AYS-375 | applicantFirstName, applicantLastName and applicantPhoneNumber Fields Have Been Added to Emergency Evacuation Application List Response (#370)
1 parent 6a6e8e7 commit 74acff1

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

src/main/java/org/ays/emergency_application/model/response/EmergencyEvacuationApplicationsResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ public class EmergencyEvacuationApplicationsResponse {
1616
private String firstName;
1717
private String lastName;
1818
private AysPhoneNumber phoneNumber;
19+
private String applicantFirstName;
20+
private String applicantLastName;
21+
private AysPhoneNumber applicantPhoneNumber;
1922
private Integer seatingCount;
2023
private EmergencyEvacuationApplicationStatus status;
2124
private Boolean isInPerson;

src/test/java/org/ays/emergency_application/controller/EmergencyEvacuationApplicationEndToEndTest.java

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class EmergencyEvacuationApplicationEndToEndTest extends AysEndToEndTest {
4848
private final EmergencyEvacuationApplicationToApplicationResponseMapper emergencyEvacuationApplicationToApplicationResponseMapper = EmergencyEvacuationApplicationToApplicationResponseMapper.initialize();
4949

5050

51-
private final String BASE_PATH = "/api/v1";
51+
private static final String BASE_PATH = "/api/v1";
5252

5353
@Test
5454
void givenValidEmergencyEvacuationApplicationListRequest_whenEmergencyEvacuationApplicationsFound_thenReturnAysPageResponseOfEmergencyEvacuationApplicationsResponse() throws Exception {
@@ -116,6 +116,14 @@ void givenValidEmergencyEvacuationApplicationListRequest_whenEmergencyEvacuation
116116
.isNotEmpty())
117117
.andExpect(AysMockResultMatchersBuilders.contents("phoneNumber.lineNumber")
118118
.isNotEmpty())
119+
.andExpect(AysMockResultMatchersBuilders.contents("applicantFirstName")
120+
.exists())
121+
.andExpect(AysMockResultMatchersBuilders.contents("applicantLastName")
122+
.exists())
123+
.andExpect(AysMockResultMatchersBuilders.contents("applicantPhoneNumber.countryCode")
124+
.exists())
125+
.andExpect(AysMockResultMatchersBuilders.contents("applicantPhoneNumber.lineNumber")
126+
.exists())
119127
.andExpect(AysMockResultMatchersBuilders.contents("seatingCount")
120128
.isNotEmpty())
121129
.andExpect(AysMockResultMatchersBuilders.contents("status")
@@ -174,25 +182,33 @@ void givenValidEmergencyEvacuationApplicationListRequest_whenEmergencyEvacuation
174182
.isNotEmpty())
175183
.andExpect(AysMockResultMatchersBuilders.contentSize()
176184
.value(0))
177-
.andExpect(AysMockResultMatchersBuilders.firstContent("id")
185+
.andExpect(AysMockResultMatchersBuilders.contents("id")
186+
.doesNotExist())
187+
.andExpect(AysMockResultMatchersBuilders.contents("referenceNumber")
188+
.doesNotExist())
189+
.andExpect(AysMockResultMatchersBuilders.contents("firstName")
190+
.doesNotExist())
191+
.andExpect(AysMockResultMatchersBuilders.contents("lastName")
178192
.doesNotExist())
179-
.andExpect(AysMockResultMatchersBuilders.firstContent("referenceNumber")
193+
.andExpect(AysMockResultMatchersBuilders.contents("phoneNumber.countryCode")
180194
.doesNotExist())
181-
.andExpect(AysMockResultMatchersBuilders.firstContent("firstName")
195+
.andExpect(AysMockResultMatchersBuilders.contents("phoneNumber.lineNumber")
182196
.doesNotExist())
183-
.andExpect(AysMockResultMatchersBuilders.firstContent("lastName")
197+
.andExpect(AysMockResultMatchersBuilders.contents("applicantFirstName")
184198
.doesNotExist())
185-
.andExpect(AysMockResultMatchersBuilders.firstContent("phoneNumber.countryCode")
199+
.andExpect(AysMockResultMatchersBuilders.contents("applicantLastName")
186200
.doesNotExist())
187-
.andExpect(AysMockResultMatchersBuilders.firstContent("phoneNumber.lineNumber")
201+
.andExpect(AysMockResultMatchersBuilders.contents("applicantPhoneNumber.countryCode")
188202
.doesNotExist())
189-
.andExpect(AysMockResultMatchersBuilders.firstContent("seatingCount")
203+
.andExpect(AysMockResultMatchersBuilders.contents("applicantPhoneNumber.lineNumber")
190204
.doesNotExist())
191-
.andExpect(AysMockResultMatchersBuilders.firstContent("status")
205+
.andExpect(AysMockResultMatchersBuilders.contents("seatingCount")
192206
.doesNotExist())
193-
.andExpect(AysMockResultMatchersBuilders.firstContent("isInPerson")
207+
.andExpect(AysMockResultMatchersBuilders.contents("status")
194208
.doesNotExist())
195-
.andExpect(AysMockResultMatchersBuilders.firstContent("createdAt")
209+
.andExpect(AysMockResultMatchersBuilders.contents("isInPerson")
210+
.doesNotExist())
211+
.andExpect(AysMockResultMatchersBuilders.contents("createdAt")
196212
.doesNotExist())
197213
.andExpect(AysMockResultMatchersBuilders.response("pageNumber")
198214
.value(1))

0 commit comments

Comments
 (0)