Examples of UserDTO


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

  @Test
  public void testCreateNewUserWithoutCredentials() {
    User newUser = MockProvider.createMockUser();
    when(identityServiceMock.newUser(MockProvider.EXAMPLE_USER_ID)).thenReturn(newUser);

    UserDto userDto = UserDto.fromUser(newUser, false);

    given()
        .body(userDto).contentType(ContentType.JSON)
    .expect()
        .statusCode(Status.NO_CONTENT.getStatusCode())
View Full Code Here

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

  public void testUserCreateExistingFails() {
    User newUser = MockProvider.createMockUser();
    when(identityServiceMock.newUser(MockProvider.EXAMPLE_USER_ID)).thenReturn(newUser);
    doThrow(new ProcessEngineException("")).when(identityServiceMock).saveUser(newUser);

    UserDto userDto = UserDto.fromUser(newUser, true);

    given()
      .body(userDto).contentType(ContentType.JSON)
    .then()
      .statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode()).contentType(ContentType.JSON)
View Full Code Here

Examples of org.camunda.bpm.engine.rest.dto.task.UserDto

    for (Group group : userGroups) {
      List<User> groupUsers = identityService.createUserQuery().memberOfGroup(group.getId()).list();
      for (User user: groupUsers) {
        if (!user.getId().equals(userId)) {
          allGroupUsers.add(new UserDto(user.getId(), user.getFirstName(), user.getLastName()));
        }
      }
      allGroups.add(new GroupDto(group.getId(), group.getName()));
    }
View Full Code Here

Examples of org.jenkinsci.plugins.activiti_explorer.dto.UserDTO

    public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
        ProxiedWebApplication webApp = getProxyWebApplication(req);

        HttpSession session = req.getSession();
        HttpSession ps = webApp.getProxiedSession(session);
        UserDTO oldUser = (UserDTO)ps.getAttribute("jenkins.user");
        UserDTO newUser = createUserInfo();
        if (!mapToId(oldUser).equals(mapToId(newUser))) {
            // force a new session. AE isn't designed to anticipate the user change without invalidating a session,
            // but Jenkins does that. So when we see that the user has changed in Jenkins, force a new session
            // (but only in AE.)
            webApp.clearProxiedSession(session);
View Full Code Here

Examples of org.jtalks.jcommune.model.dto.UserDto

    }

    @Test
    public void testValidateUserIfThereNoValidationErrorsShouldBeSuccessful()
            throws UnexpectedErrorException, NoConnectionException {
        UserDto userDto = new UserDto();
        Long pluginId = 1L;
        KaptchaPluginService service = mock(KaptchaPluginService.class);
        when(service.validateCaptcha(userDto, pluginId)).thenReturn(Collections.EMPTY_MAP);
        when(kaptchaPlugin.getService()).thenReturn(service);
View Full Code Here

Examples of org.krams.response.UserDto

import org.springframework.data.domain.Page;

public class UserMapper {

  public static UserDto map(User user) {
      UserDto dto = new UserDto();
      dto.setId(user.getId());
      dto.setFirstName(user.getFirstName());
      dto.setLastName(user.getLastName());
      dto.setUsername(user.getUsername());
      dto.setRole(user.getRole().getRole());
      return dto;
  }
View Full Code Here

Examples of org.multibit.mbm.client.interfaces.rest.api.user.UserDto

        Optional<UserDto> anonymousUserOptional = PublicMerchantClient
          .newInstance(Locale.getDefault())
          .user()
          .registerAnonymously();
        if (anonymousUserOptional.isPresent()) {
          UserDto anonymousUser = anonymousUserOptional.get();
          anonymousUser.setSessionToken(UUID.randomUUID());
          // Keep a copy in the session cache
          InMemorySessionTokenCache
            .INSTANCE
            .put(anonymousUser.getSessionToken(), anonymousUser);
        }
        return anonymousUserOptional;

      }
View Full Code Here

Examples of org.multibit.mbm.client.interfaces.rest.api.user.UserDto

      // User has been authenticated by the upstream server

      // Create a session token to allow ongoing cookie authentication
      UUID sessionToken = UUID.randomUUID();

      UserDto clientUser = clientUserOptional.get();
      clientUser.setSessionToken(sessionToken);

      // Cache this user to allow cookie authentication
      InMemorySessionTokenCache
        .INSTANCE
        .put(sessionToken, clientUserOptional.get());
View Full Code Here

Examples of org.multibit.mbm.client.interfaces.rest.api.user.UserDto

    // Arrange
    final CartDto expectedCart = new CartDto();
    expectedCart.setItemTotal("2");

    final UserDto clientUser = new UserDto();
    clientUser.setApiKey("apiKey");
    clientUser.setSecretKey("secretKey");

    URI expectedUri = URI.create("http://localhost:8080/mbm/cart");

    // Test-specific JerseyClient behaviour
    when(client.resource(expectedUri))
View Full Code Here

Examples of org.multibit.mbm.client.interfaces.rest.api.user.UserDto

    // Arrange
    final CartDto expectedCart = new CartDto();
    expectedCart.setItemTotal("2");

    final UserDto clientUser = new UserDto();
    clientUser.setApiKey("apiKey");
    clientUser.setSecretKey("secretKey");

    URI expectedUri = URI.create("http://localhost:8080/mbm/cart");

    // Test-specific JerseyClient behaviour
    when(client.resource(expectedUri))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.