Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong committed Jan 10, 2024
1 parent 8f59df8 commit 728ac08
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void initResource() {
}

@Test
public void testGetResourceTypes() throws Exception {
void testGetResourceTypes() throws Exception {
ActionPattern pattern = new ActionPattern()
.setAuthDomainConstrainable(true)
.setDescription("description")
Expand All @@ -79,7 +79,7 @@ public void testGetResourceTypes() throws Exception {
}

@Test
public void testPostRegistrationInfo() throws Exception {
void testPostRegistrationInfo() throws Exception {
UserStatus.UserInfo info = new UserStatus.UserInfo().setUserEmail("[email protected]")
.setUserSubjectId("subjectId");
UserStatus.Enabled enabled = new UserStatus.Enabled().setAllUsersGroup(true).setGoogle(true)
Expand All @@ -92,7 +92,7 @@ public void testPostRegistrationInfo() throws Exception {
}

@Test
public void testGetSelfDiagnostics() throws Exception {
void testGetSelfDiagnostics() throws Exception {
UserStatusDiagnostics diagnostics = new UserStatusDiagnostics()
.setAdminEnabled(RandomUtils.nextBoolean())
.setEnabled(RandomUtils.nextBoolean())
Expand All @@ -106,7 +106,7 @@ public void testGetSelfDiagnostics() throws Exception {
}

@Test
public void testGetRegistrationInfo() throws Exception {
void testGetRegistrationInfo() throws Exception {
UserStatusInfo userInfo = new UserStatusInfo()
.setAdminEnabled(RandomUtils.nextBoolean())
.setUserEmail("[email protected]")
Expand All @@ -119,15 +119,15 @@ public void testGetRegistrationInfo() throws Exception {
}

@Test
public void testPostSelfTos() throws Exception {
void testPostSelfTos() throws Exception {
when(samService.postTosAcceptedStatus(any())).thenReturn(200);
initResource();
Response response = resource.postSelfTos(authUser);
assertEquals(HttpStatusCodes.STATUS_CODE_OK, response.getStatus());
}

@Test
public void testPostSelfTos_NoConsentUser() throws Exception {
void testPostSelfTos_NoConsentUser() throws Exception {
doThrow(new NotFoundException()).when(userService).findUserByEmail(any());
when(samService.postTosAcceptedStatus(any())).thenReturn(200);
initResource();
Expand All @@ -138,17 +138,17 @@ public void testPostSelfTos_NoConsentUser() throws Exception {
}

@Test
public void testPostSelfTos_ExistingSamUser() throws Exception {
void testPostSelfTos_ExistingSamUser() throws Exception {
doThrow(new ConsentConflictException()).when(samService).postRegistrationInfo(any());
when(samService.postTosAcceptedStatus(any())).thenReturn(409);
when(samService.postTosAcceptedStatus(any())).thenReturn(200);
initResource();

Response response = resource.postSelfTos(authUser);
assertEquals(HttpStatusCodes.STATUS_CODE_OK, response.getStatus());
}

@Test
public void testRemoveSelfTos() throws Exception {
void testRemoveSelfTos() throws Exception {
when(samService.removeTosAcceptedStatus(any())).thenReturn(200);
initResource();
Response response = resource.removeTos(authUser);
Expand Down

0 comments on commit 728ac08

Please sign in to comment.