Search in sources :

Example 1 with UserManagementService

use of org.graylog2.shared.users.UserManagementService in project graylog2-server by Graylog2.

the class UsersResourceTest method createSuccess.

/**
 * Verify user is successfully created in the Create flow.
 * This tests the integration between the UsersResource and UserManagementServiceImpl.
 */
@Test
public void createSuccess() throws ValidationException {
    when(userManagementService.create()).thenReturn(userImplFactory.create(new HashMap<>()));
    final Response response = usersResource.create(buildCreateUserRequest());
    Assert.assertEquals(201, response.getStatus());
    verify(userManagementService, times(1)).create(isA(UserImpl.class));
}
Also used : Response(javax.ws.rs.core.Response) HashMap(java.util.HashMap) UserImpl(org.graylog2.users.UserImpl) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 Response (javax.ws.rs.core.Response)1 UserImpl (org.graylog2.users.UserImpl)1 Test (org.junit.Test)1