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));
}