-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
80 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
src/main/java/org/broadinstitute/consent/http/models/sam/TosResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ | |
import org.broadinstitute.consent.http.models.sam.ActionPattern; | ||
import org.broadinstitute.consent.http.models.sam.ResourceType; | ||
import org.broadinstitute.consent.http.models.sam.ResourceTypeRole; | ||
import org.broadinstitute.consent.http.models.sam.TosResponse; | ||
import org.broadinstitute.consent.http.models.sam.UserStatus; | ||
import org.broadinstitute.consent.http.models.sam.UserStatusDiagnostics; | ||
import org.broadinstitute.consent.http.models.sam.UserStatusInfo; | ||
|
@@ -121,28 +120,16 @@ public void testGetRegistrationInfo() throws Exception { | |
|
||
@Test | ||
public void testPostSelfTos() throws Exception { | ||
TosResponse.Enabled enabled = new TosResponse.Enabled() | ||
.setAdminEnabled(true).setTosAccepted(true).setGoogle(true).setAllUsersGroup(true) | ||
.setLdap(true); | ||
UserStatus.UserInfo info = new UserStatus.UserInfo().setUserEmail("[email protected]") | ||
.setUserSubjectId("subjectId"); | ||
TosResponse tosResponse = new TosResponse().setEnabled(enabled).setUserInfo(info); | ||
when(samService.postTosAcceptedStatus(any())).thenReturn(tosResponse); | ||
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 { | ||
TosResponse.Enabled enabled = new TosResponse.Enabled() | ||
.setAdminEnabled(true).setTosAccepted(true).setGoogle(true).setAllUsersGroup(true) | ||
.setLdap(true); | ||
UserStatus.UserInfo info = new UserStatus.UserInfo().setUserEmail("[email protected]") | ||
.setUserSubjectId("subjectId"); | ||
TosResponse tosResponse = new TosResponse().setEnabled(enabled).setUserInfo(info); | ||
doThrow(new NotFoundException()).when(userService).findUserByEmail(any()); | ||
when(samService.postTosAcceptedStatus(any())).thenReturn(tosResponse); | ||
when(samService.postTosAcceptedStatus(any())).thenReturn(200); | ||
initResource(); | ||
|
||
Response response = resource.postSelfTos(authUser); | ||
|
@@ -152,14 +139,8 @@ public void testPostSelfTos_NoConsentUser() throws Exception { | |
|
||
@Test | ||
public void testPostSelfTos_ExistingSamUser() throws Exception { | ||
TosResponse.Enabled enabled = new TosResponse.Enabled() | ||
.setAdminEnabled(true).setTosAccepted(true).setGoogle(true).setAllUsersGroup(true) | ||
.setLdap(true); | ||
UserStatus.UserInfo info = new UserStatus.UserInfo().setUserEmail("[email protected]") | ||
.setUserSubjectId("subjectId"); | ||
TosResponse tosResponse = new TosResponse().setEnabled(enabled).setUserInfo(info); | ||
doThrow(new ConsentConflictException()).when(samService).postRegistrationInfo(any()); | ||
when(samService.postTosAcceptedStatus(any())).thenReturn(tosResponse); | ||
when(samService.postTosAcceptedStatus(any())).thenReturn(409); | ||
initResource(); | ||
|
||
Response response = resource.postSelfTos(authUser); | ||
|
@@ -168,13 +149,7 @@ public void testPostSelfTos_ExistingSamUser() throws Exception { | |
|
||
@Test | ||
public void testRemoveSelfTos() throws Exception { | ||
TosResponse.Enabled enabled = new TosResponse.Enabled() | ||
.setAdminEnabled(true).setTosAccepted(false).setGoogle(true).setAllUsersGroup(true) | ||
.setLdap(true); | ||
UserStatus.UserInfo info = new UserStatus.UserInfo().setUserEmail("[email protected]") | ||
.setUserSubjectId("subjectId"); | ||
TosResponse tosResponse = new TosResponse().setEnabled(enabled).setUserInfo(info); | ||
when(samService.removeTosAcceptedStatus(any())).thenReturn(tosResponse); | ||
when(samService.removeTosAcceptedStatus(any())).thenReturn(200); | ||
initResource(); | ||
Response response = resource.removeTos(authUser); | ||
assertEquals(HttpStatusCodes.STATUS_CODE_OK, response.getStatus()); | ||
|
Oops, something went wrong.