@Test
public void testModify() {

    AdminUserResource resource = new AdminUserResource();
    // Inject OSGi services into the resource
    UserManagementService useradmin = mock(UserManagementService.class);
    resource.useradmin = useradmin;
    UkelonnService ukelonn = mock(UkelonnService.class);
    resource.ukelonn = ukelonn;
    MockLogService logservice = new MockLogService();
    resource.logservice = logservice;
    // Get first user and modify all properties except id
    String modifiedUsername = "gandalf";
    String modifiedEmailaddress = "wizard@hotmail.com";
    String modifiedFirstname = "Gandalf";
    String modifiedLastname = "Grey";
    User user = new User(1, modifiedUsername, modifiedEmailaddress, modifiedFirstname, modifiedLastname);
    when(useradmin.modifyUser(user)).thenReturn(Arrays.asList(user));
    // Save the modification
    List<User> updatedUsers = resource.modify(user);
    // Verify that the first user has the modified values
    User firstUser = updatedUsers.get(0);
    assertEquals(modifiedUsername, firstUser.getUsername());
    assertEquals(modifiedEmailaddress, firstUser.getEmail());
    assertEquals(modifiedFirstname, firstUser.getFirstname());
    assertEquals(modifiedLastname, firstUser.getLastname());
}