Skip to content

Commit

Permalink
Mutation test coverage (#575)
Browse files Browse the repository at this point in the history
* typeahead api changes
  • Loading branch information
arshinsalim authored Jun 15, 2023
1 parent 1f73b93 commit 6073c8c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 0 additions & 1 deletion config/owasp/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@
<packageUrl regex="true">^pkg:maven/org\.yaml/snakeyaml@.*$</packageUrl>
<cve>CVE-2022-1471</cve>
</suppress>

</suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

import static java.nio.charset.Charset.defaultCharset;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.Mockito.any;
Expand Down Expand Up @@ -439,6 +441,7 @@ void test_refreshUserProfile_BasedOnPersonalCodes_Error() throws JsonProcessingE


@Test
@SuppressWarnings("unchecked")
void test_refreshUserProfile_BasedOnPersonalCodes_200() {
var userProfile = buildUserProfileIac();

Expand All @@ -465,12 +468,23 @@ void test_refreshUserProfile_BasedOnPersonalCodes_200() {
null, null, Arrays.asList("Emp", "Emp", null));
var responseEntity = judicialUserService.refreshUserProfile(refreshRoleRequest, 1,
0, "ASC", "objectId");

List<uk.gov.hmcts.reform.judicialapi.controller.response.UserProfileRefreshResponse>
userProfileRefreshResponses = (List<uk.gov.hmcts.reform.judicialapi.controller
.response.UserProfileRefreshResponse>) responseEntity.getBody();
assertEquals(200, responseEntity.getStatusCodeValue());
assertNotNull(userProfileRefreshResponses.get(0).getAppointments().get(0).getStartDate());
assertNull(userProfileRefreshResponses.get(0).getAppointments().get(0).getEndDate());
assertNotNull(userProfileRefreshResponses.get(0).getAuthorisations().get(0).getStartDate());
assertNull(userProfileRefreshResponses.get(0).getAuthorisations().get(0).getEndDate());
assertNull(userProfileRefreshResponses.get(0).getAppointments().get(0).getCftRegionID());
assertNull(userProfileRefreshResponses.get(0).getAppointments().get(0).getCftRegion());
assertNotNull(userProfileRefreshResponses.get(0).getAuthorisations().get(0).getServiceCodes().get(0));
assertNotNull(userProfileRefreshResponses.get(0).getAppointments().get(0).getEpimmsId());

}

@Test
void test_refreshUserProfile_BasedOnPersonalCodes_400() throws JsonProcessingException {
void test_refreshUserProfile_BasedOnPersonalCodes_400() throws JsonProcessingException {

var refreshRoleRequest = new RefreshRoleRequest("",
null, null, Arrays.asList("Emp", "Emp", null));
Expand Down

0 comments on commit 6073c8c

Please sign in to comment.