Package org.camunda.bpm.engine.rest.dto.identity

Examples of org.camunda.bpm.engine.rest.dto.identity.UserProfileDto


    UserDto user = new UserDto();
    UserCredentialsDto credentials = new UserCredentialsDto();
    credentials.setPassword(password);
    user.setCredentials(credentials);
    UserProfileDto profile = new UserProfileDto();
    profile.setId(id);
    profile.setFirstName(firstName);
    profile.setLastName(lastName);
    user.setProfile(profile);

    WebResource webResource = client.resource(testProperties.getApplicationPath("/camunda/api/admin/setup/default/user/create"));
    ClientResponse clientResponse = webResource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).post(ClientResponse.class, user);
    try {
View Full Code Here


    User dbUser = findUserObject();
    if(dbUser == null) {
      throw new InvalidRequestException(Status.NOT_FOUND, "User with id " + resourceId + " does not exist");
    }

    UserProfileDto user = UserProfileDto.fromUser(dbUser);

    return user;
  }
View Full Code Here

    if(identityService.isReadOnly()) {
      throw new InvalidRequestException(Status.FORBIDDEN, "Identity service implementation is read-only.");
    }

    UserProfileDto profile = userDto.getProfile();
    if(profile == null || profile.getId() == null) {
      throw new InvalidRequestException(Status.BAD_REQUEST, "request object must provide profile information with valid id.");
    }

    User newUser = identityService.newUser(profile.getId());
    profile.update(newUser);

    if(userDto.getCredentials() != null) {
      newUser.setPassword(userDto.getCredentials().getPassword());
    }
View Full Code Here

    UserQuery sampleUserQuery = mock(UserQuery.class);
    when(identityServiceMock.createUserQuery()).thenReturn(sampleUserQuery);
    when(sampleUserQuery.userId(MockProvider.EXAMPLE_USER_ID)).thenReturn(sampleUserQuery);
    when(sampleUserQuery.singleResult()).thenReturn(initialUser);

    UserProfileDto updateDto = UserProfileDto.fromUser(userUpdate);

    given()
        .pathParam("id", MockProvider.EXAMPLE_USER_ID)
        .body(updateDto).contentType(ContentType.JSON)
    .then()
        .statusCode(Status.NO_CONTENT.getStatusCode())
    .when()
        .put(USER_PROFILE_URL);

    // password was updated
    verify(initialUser).setEmail(updateDto.getEmail());
    verify(initialUser).setFirstName(updateDto.getFirstName());
    verify(initialUser).setLastName(updateDto.getLastName());

    // and then saved
    verify(identityServiceMock).saveUser(initialUser);
  }
View Full Code Here

    UserQuery sampleUserQuery = mock(UserQuery.class);
    when(identityServiceMock.createUserQuery()).thenReturn(sampleUserQuery);
    when(sampleUserQuery.userId("aNonExistingUser")).thenReturn(sampleUserQuery);
    when(sampleUserQuery.singleResult()).thenReturn(null);

    UserProfileDto updateDto = UserProfileDto.fromUser(userUpdate);

    given()
        .pathParam("id", "aNonExistingUser")
        .body(updateDto).contentType(ContentType.JSON)
    .then()
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.rest.dto.identity.UserProfileDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.