use of org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIEERepositoryUser in project pentaho-kettle by pentaho.
the class UIEESecurityTest method testAddUser.
@Test
public void testAddUser() throws Exception {
try {
security.setSelectedDeck(ObjectRecipient.Type.USER);
UIEERepositoryUser userToAdd = new UIEERepositoryUser(new EEUserInfo());
userToAdd.setName("newuser");
userToAdd.setPassword("newpassword");
userToAdd.setDescription("new description");
Set<IUIRole> rolesToAssign = new HashSet<IUIRole>();
rolesToAssign.add(new UIRepositoryRole(ctoRole));
rolesToAssign.add(new UIRepositoryRole(isRole));
rolesToAssign.add(new UIRepositoryRole(adminRole));
rolesToAssign.add(new UIRepositoryRole(authenticatedRole));
userToAdd.setRoles(rolesToAssign);
security.addUser(userToAdd);
assertEquals(security.getSelectedUser(), userToAdd);
assertEquals(security.getSelectedDeck(), ObjectRecipient.Type.USER);
assertEquals(security.getUserList().size(), 5);
} catch (Exception e) {
Assert.fail();
}
}
Aggregations