@Test
public void removeUserRoleTest() {

    Response response = target().path("users/" + UsernameTestFilter.USERNAME + "/roles").queryParam("role", "testRole")
            .request().delete();
    assertEquals(response.getStatus(), 200);
    verify(engineManager).retrieveUser(UsernameTestFilter.USERNAME);
    ArgumentCaptor<User> captor = ArgumentCaptor.forClass(User.class);
    verify(engineManager).updateUser(captor.capture());
    User updatedUser = captor.getValue();
    assertEquals(user.getResource(), updatedUser.getResource());
    assertEquals(0, updatedUser.getHasUserRole_resource().size());
}