-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTSRD-2132.Update contactinformation for an organisation #1576
base: master
Are you sure you want to change the base?
Conversation
...gov/hmcts/reform/professionalapi/controller/internal/OrganisationInternalControllerTest.java
Outdated
Show resolved
Hide resolved
src/main/java/uk/gov/hmcts/reform/professionalapi/service/impl/OrganisationServiceImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see inlined comments
d81e6b6
Plan Result (aat)
|
Plan Result (prod)
|
.hasSizeGreaterThan(0); | ||
|
||
List<ContactInformationCreationRequest> contactInformationCreationRequestList = | ||
professionalApiClient.createContactInformationCreationRequests(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still new and existing contact addresses and DX are same
existingContactInfo.get("addressId").toString()); | ||
|
||
assertNotNull(result); | ||
assertThat(result.getBody()).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add assertions to verify the new DX and contact address details
HashMap existingContactInfo = existingContactInformationList.get(0); | ||
|
||
Response result = professionalApiClient.updateContactInformationsToOrganisation( | ||
aContactInformationCreationRequest().addressLine1("addressLine1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to update dx address alone , do you still need to pass addressLine1 ?
existingContactInfo.get("addressId").toString()); | ||
|
||
assertNotNull(result); | ||
assertThat(result.getBody()).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add assertions to verify the new DX address details
@@ -1231,4 +1233,267 @@ private static List<Map<String, Object>> sortByValue(final List<Map<String, Obje | |||
.sorted(Comparator.comparing(map -> (String) map.get(key))) | |||
.collect(Collectors.toList()); | |||
} | |||
|
|||
@Test | |||
@ExtendWith(FeatureToggleConditionExtension.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is not required, remove it : @ExtendWith(FeatureToggleConditionExtension.class)
} | ||
|
||
@Test | ||
void shouldReturn400InvalidDatainRequest() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change method name to shouldReturn400WhenAddressLine1IsNull
|
||
assertThat(updateResponse).containsEntry("http_status", 200); | ||
|
||
assertThat(existingUpdated.get("addressLine1").toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old and new data are same, add prefix "updated" to each new field so that it is easy to identify what is updated data.
Map<String, Object> updateResponse = professionalReferenceDataClient | ||
.updateOrgContactInformation(contactInformationCreationRequest, | ||
hmctsAdmin,orgIdentifier,false, | ||
true,""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont need to pass empty addressId
.updateOrgContactInformation(contactInformationCreationRequest, hmctsAdmin,organisationIdentifier, | ||
true,true,""); | ||
|
||
assertThat(updateResponse).containsEntry("http_status", "500"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your test method says should return 400 but you are asserting 500, api should return 400 with error "DX Address details are missing"
deleteOrganisation(organisationIdentifier); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add below test cases for dx address update, sometimes we may have to update only one field:
- to update DX Exchange field alone
- to update DX address number alone
Jira link (if applicable)
Change description
Checklist