use of org.pentaho.platform.security.userroledao.ws.UserRoleWebService in project pentaho-platform by pentaho.
the class UserRoleWebServiceBase method testCreateBlankUser.
@Test
public void testCreateBlankUser() throws UserRoleException {
UserRoleWebService userRoleWebService = new UserRoleWebService();
ProxyPentahoUser proxyPentahoUser = new ProxyPentahoUser();
try {
userRoleWebService.createUser(proxyPentahoUser);
Assert.fail();
} catch (UserRoleException e) {
Assert.assertEquals(0, e.getStackTrace().length);
}
}
use of org.pentaho.platform.security.userroledao.ws.UserRoleWebService in project pentaho-platform by pentaho.
the class UserRoleEndpointIT method setUp.
@Before
public void setUp() throws Exception {
try {
// $NON-NLS-1$
Endpoint.publish("http://localhost:9891/test", new UserRoleWebService());
} catch (Throwable th) {
// ignore
}
System.setProperty("com.sun.xml.ws.monitoring.endpoint", "true");
System.setProperty("com.sun.xml.ws.monitoring.client", "true");
System.setProperty("com.sun.xml.ws.monitoring.registrationDebug", "FINE");
System.setProperty("com.sun.xml.ws.monitoring.runtimeDebug", "true");
Service service = Service.create(new URL("http://localhost:9891/test?wsdl"), new QName("http://www.pentaho.org/ws/1.0", "userRoleService"));
mockUserAsAdmin(true);
userRoleWebService = service.getPort(IUserRoleWebService.class);
}
use of org.pentaho.platform.security.userroledao.ws.UserRoleWebService in project pentaho-platform by pentaho.
the class UserRoleWebServiceBase method testCreateDuplicateRole.
@Test
public void testCreateDuplicateRole() throws UserRoleException {
UserRoleDaoMock userRoleDao = Mockito.mock(UserRoleDaoMock.class);
Mockito.doThrow(new AlreadyExistsException("That role already exists.")).when(userRoleDao).createRole(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any());
UserRoleWebService userRoleWebService = new UserRoleWebService() {
@Override
protected IUserRoleDao getDao() throws UserRoleException {
return userRoleDao;
}
};
ProxyPentahoRole proxyPentahoRole = new ProxyPentahoRole("testrole");
try {
userRoleWebService.createRole(proxyPentahoRole);
Assert.fail();
} catch (AlreadyExistsException e) {
Assert.assertEquals(0, e.getStackTrace().length);
}
}
use of org.pentaho.platform.security.userroledao.ws.UserRoleWebService in project pentaho-platform by pentaho.
the class UserRoleWebServiceBase method testCreateDuplicateUser.
@Test
public void testCreateDuplicateUser() throws UserRoleException {
UserRoleDaoMock userRoleDao = Mockito.mock(UserRoleDaoMock.class);
Mockito.doThrow(new AlreadyExistsException("That user name already exists.")).when(userRoleDao).createUser(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any());
UserRoleWebService userRoleWebService = new UserRoleWebService() {
@Override
protected IUserRoleDao getDao() throws UserRoleException {
return userRoleDao;
}
};
ProxyPentahoUser proxyPentahoUser = new ProxyPentahoUser();
proxyPentahoUser.setName("test");
proxyPentahoUser.setEnabled(true);
proxyPentahoUser.setPassword("test");
proxyPentahoUser.setDescription("testing");
try {
userRoleWebService.createUser(proxyPentahoUser);
Assert.fail();
} catch (AlreadyExistsException e) {
Assert.assertEquals(0, e.getStackTrace().length);
}
}
use of org.pentaho.platform.security.userroledao.ws.UserRoleWebService in project pentaho-platform by pentaho.
the class UserRoleWebServiceBase method testCreateBlankRole.
@Test
public void testCreateBlankRole() throws UserRoleException {
UserRoleWebService userRoleWebService = new UserRoleWebService();
ProxyPentahoRole proxyPentahoRole = new ProxyPentahoRole();
try {
userRoleWebService.createRole(proxyPentahoRole);
Assert.fail();
} catch (UserRoleException e) {
Assert.assertEquals(0, e.getStackTrace().length);
}
}
Aggregations