use of edu.hawaii.its.groupings.controller.WithMockUhUser in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingsRestControllerTest method groupingsOwnedTest.
@Test
@WithMockUhUser
public void groupingsOwnedTest() throws Exception {
String uri = REST_CONTROLLER_BASE + "owners/groupings";
given(httpRequestService.makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.GET))).willReturn(new ResponseEntity(HttpStatus.OK));
assertNotNull(mockMvc.perform(get(uri).with(csrf())).andExpect(status().isOk()).andReturn());
verify(httpRequestService, times(1)).makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.GET));
}
use of edu.hawaii.its.groupings.controller.WithMockUhUser in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingsRestControllerTest method setOptInTrueTest.
@Test
@WithMockUhUser
public void setOptInTrueTest() throws Exception {
String uri_true = REST_CONTROLLER_BASE + GROUPING + "/true/setOptIn";
given(httpRequestService.makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.PUT))).willReturn(new ResponseEntity(HttpStatus.OK));
assertNotNull(mockMvc.perform(post(uri_true).with(csrf())).andExpect(status().isOk()).andReturn());
verify(httpRequestService, times(1)).makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.PUT));
}
use of edu.hawaii.its.groupings.controller.WithMockUhUser in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingsRestControllerTest method membershipResultsTest.
@Test
@WithMockUhUser
public void membershipResultsTest() throws Exception {
String uri = REST_CONTROLLER_BASE + "members/groupings";
given(httpRequestService.makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.GET))).willReturn(new ResponseEntity(HttpStatus.OK));
assertNotNull(mockMvc.perform(get(uri)).andExpect(status().isOk()).andReturn());
verify(httpRequestService, times(1)).makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.GET));
}
use of edu.hawaii.its.groupings.controller.WithMockUhUser in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingsRestControllerTest method allSyncDestinationsTest.
@Test
@WithMockUhUser
public void allSyncDestinationsTest() throws Exception {
String uri = REST_CONTROLLER_BASE + "/groupings/" + GROUPING + "/syncDestinations";
given(httpRequestService.makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.GET))).willReturn(new ResponseEntity(HttpStatus.OK));
assertNotNull(mockMvc.perform(get(uri).with(csrf())).andExpect(status().isOk()).andReturn());
verify(httpRequestService, times(1)).makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.GET));
}
use of edu.hawaii.its.groupings.controller.WithMockUhUser in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingsRestControllerTest method removeMembersFromExcludeGroupTest.
@Test
@WithMockUhUser
public void removeMembersFromExcludeGroupTest() throws Exception {
String uri = REST_CONTROLLER_BASE + GROUPING + "/" + USERNAME + "/removeMembersFromExcludeGroup";
given(httpRequestService.makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.DELETE))).willReturn(new ResponseEntity(HttpStatus.OK));
assertNotNull(mockMvc.perform(post(uri).with(csrf())).andExpect(status().isOk()).andReturn());
verify(httpRequestService, times(1)).makeApiRequest(eq(USERNAME), anyString(), eq(HttpMethod.DELETE));
}
Aggregations