use of io.lumeer.api.model.User in project engine by Lumeer.
the class UserServiceIT method prepareUser.
private User prepareUser(String organizationId, String user) {
User u = new User(user);
u.setName(user);
u.setGroups(Collections.singletonMap(organizationId, GROUPS));
return u;
}
use of io.lumeer.api.model.User in project engine by Lumeer.
the class UserServiceIT method testUpdateUser.
@Test
public void testUpdateUser() {
createUser(organizationId1, USER1);
User storedUser = getUser(organizationId1, USER1);
assertThat(storedUser).isNotNull();
User updateUser = prepareUser(organizationId1, USER2);
Entity entity = Entity.json(updateUser);
Response response = client.target(getPath(organizationId1)).path(storedUser.getId()).request(MediaType.APPLICATION_JSON).buildPut(entity).invoke();
assertThat(response).isNotNull();
assertThat(response.getStatusInfo()).isEqualTo(Response.Status.OK);
storedUser = getUser(organizationId1, USER1);
assertThat(storedUser).isNull();
storedUser = getUser(organizationId1, USER2);
assertThat(storedUser).isNotNull();
}
use of io.lumeer.api.model.User in project engine by Lumeer.
the class UserServiceIT method testDeleteUser.
@Test
public void testDeleteUser() {
createUser(organizationId1, USER1);
User storedUser = getUser(organizationId1, USER1);
assertThat(storedUser).isNotNull();
Response response = client.target(getPath(organizationId1)).path(storedUser.getId()).request(MediaType.APPLICATION_JSON).buildDelete().invoke();
assertThat(response).isNotNull();
assertThat(response.getStatusInfo()).isEqualTo(Response.Status.OK);
storedUser = getUser(organizationId1, USER1);
assertThat(storedUser).isNull();
}
use of io.lumeer.api.model.User in project engine by Lumeer.
the class ViewServiceIT method configureProject.
@Before
public void configureProject() {
MorphiaOrganization organization = new MorphiaOrganization();
organization.setCode(ORGANIZATION_CODE);
organization.setPermissions(new MorphiaPermissions());
Organization storedOrganization = organizationDao.createOrganization(organization);
projectDao.setOrganization(storedOrganization);
User user = new User(USER);
userDao.createUser(user);
MorphiaProject project = new MorphiaProject();
project.setCode(PROJECT_CODE);
project.setPermissions(new MorphiaPermissions());
Project storedProject = projectDao.createProject(project);
viewDao.setProject(storedProject);
}
use of io.lumeer.api.model.User in project engine by Lumeer.
the class ProjectServicePermissionsIT method configureProject.
@Before
public void configureProject() {
MorphiaOrganization organization = new MorphiaOrganization();
organization.setCode(organizationCode);
organization.setName(organizationName);
organization.setPermissions(new MorphiaPermissions());
organization.getPermissions().updateUserPermissions(new MorphiaPermission(userEmail, Role.toStringRoles(new HashSet<>(Arrays.asList(Role.WRITE, Role.READ, Role.MANAGE)))));
Organization storedOrganization = organizationDao.createOrganization(organization);
projectDao.setOrganization(storedOrganization);
workspaceKeeper.setOrganization(organizationCode);
User user = new User(userEmail);
userDao.createUser(user);
}
Aggregations