Package org.camunda.bpm.engine.identity

Examples of org.camunda.bpm.engine.identity.User


    verify(identityServiceMock).saveUser(initialUser);
  }

  @Test
  public void testChangeCredentialsWithWrongAuthenticatedUserPassword() {
    User initialUser = MockProvider.createMockUser();
    UserQuery sampleUserQuery = mock(UserQuery.class);
    when(identityServiceMock.createUserQuery()).thenReturn(sampleUserQuery);
    when(sampleUserQuery.userId(MockProvider.EXAMPLE_USER_ID)).thenReturn(sampleUserQuery);
    when(sampleUserQuery.singleResult()).thenReturn(initialUser);
View Full Code Here


    verify(identityServiceMock, never()).saveUser(any(User.class));
  }

  @Test
  public void testPutProfile() {
    User initialUser = MockProvider.createMockUser();
    User userUpdate = MockProvider.createMockUserUpdate();

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

    verify(identityServiceMock).saveUser(initialUser);
  }

  @Test
  public void testPutProfileNonexistingFails() {
    User userUpdate = MockProvider.createMockUserUpdate();

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

    verify(identityServiceMock, never()).saveUser(any(User.class));
  }

  @Test
  public void testReadOnlyUserCreateFails() {
    User newUser = MockProvider.createMockUser();
    when(identityServiceMock.isReadOnly()).thenReturn(true);

    given().body(UserDto.fromUser(newUser, true)).contentType(ContentType.JSON)
      .then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON)
      .body("type", equalTo(InvalidRequestException.class.getSimpleName()))
View Full Code Here

    verify(identityServiceMock, never()).newUser(MockProvider.EXAMPLE_USER_ID);
  }

  @Test
  public void testReadOnlyPutUserProfileFails() {
    User userUdpdate = MockProvider.createMockUser();
    when(identityServiceMock.isReadOnly()).thenReturn(true);

    given()
        .pathParam("id", MockProvider.EXAMPLE_USER_ID)
        .body(UserProfileDto.fromUser(userUdpdate)).contentType(ContentType.JSON)
View Full Code Here

    verify(identityServiceMock, never()).saveUser(userUdpdate);
  }

  @Test
  public void testReadOnlyPutUserCredentialsFails() {
    User userUdpdate = MockProvider.createMockUser();
    when(identityServiceMock.isReadOnly()).thenReturn(true);

    given()
        .pathParam("id", MockProvider.EXAMPLE_USER_ID)
        .body(UserCredentialsDto.fromUser(userUdpdate)).contentType(ContentType.JSON)
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.identity.User

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.