use of org.broadinstitute.consent.http.models.sam.TosResponse in project consent by DataBiosphere.
the class SamServiceTest method testPostTosAcceptedStatus.
@Test
public void testPostTosAcceptedStatus() {
TosResponse.Enabled enabled = new TosResponse.Enabled().setAdminEnabled(true).setTosAccepted(true).setGoogle(true).setAllUsersGroup(true).setLdap(true);
UserStatus.UserInfo info = new UserStatus.UserInfo().setUserEmail("test@test.org").setUserSubjectId("subjectId");
TosResponse tosResponse = new TosResponse().setEnabled(enabled).setUserInfo(info);
mockServerClient.when(request()).respond(response().withHeader(Header.header("Content-Type", "application/json")).withStatusCode(200).withBody(tosResponse.toString()));
try {
service.postTosAcceptedStatus(authUser);
} catch (Exception e) {
fail(e.getMessage());
}
}
use of org.broadinstitute.consent.http.models.sam.TosResponse in project consent by DataBiosphere.
the class SamResourceTest method testPostSelfTos.
@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("test@test.org").setUserSubjectId("subjectId");
TosResponse tosResponse = new TosResponse().setEnabled(enabled).setUserInfo(info);
when(service.postTosAcceptedStatus(any())).thenReturn(tosResponse);
initResource();
Response response = resource.postSelfTos(authUser);
assertEquals(HttpStatusCodes.STATUS_CODE_OK, response.getStatus());
}
Aggregations