use of org.pentaho.platform.web.http.api.resources.RoleListWrapper in project pentaho-platform by pentaho.
the class UserRoleListServiceTest method testDoGetAllRoles.
@Test
public void testDoGetAllRoles() {
List<String> roles = new ArrayList<String>();
roles.add("ROLE1");
roles.add("ROLE2");
List<String> extraRoles = new ArrayList<String>();
extraRoles.add("ROLE3");
extraRoles.add("ROLE4");
IUserRoleListService userRoleListService1 = mock(IUserRoleListService.class);
doReturn(userRoleListService1).when(userRoleListService).getUserRoleListService();
doReturn(roles).when(userRoleListService1).getAllRoles();
doReturn(extraRoles).when(userRoleListService).getExtraRoles();
RoleListWrapper roleListWrapper = userRoleListService.getAllRoles();
verify(userRoleListService).getUserRoleListService();
verify(userRoleListService1).getAllRoles();
verify(userRoleListService).getExtraRoles();
assertEquals(4, roleListWrapper.getRoles().size());
}
use of org.pentaho.platform.web.http.api.resources.RoleListWrapper in project pentaho-platform by pentaho.
the class UserRoleListServiceTest method testDoGetExtraRolesList.
@Test
public void testDoGetExtraRolesList() {
List<String> extraRoles = new ArrayList<String>();
extraRoles.add("ROLE1");
extraRoles.add("ROLE2");
extraRoles.add("ROLE3");
extraRoles.add("ROLE4");
doReturn(extraRoles).when(userRoleListService).getExtraRoles();
RoleListWrapper roleListWrapper = userRoleListService.getExtraRolesList();
verify(userRoleListService).getExtraRoles();
assertEquals(4, roleListWrapper.getRoles().size());
assertEquals(extraRoles, roleListWrapper.getRoles());
}
Aggregations