@Test
public void getUsernameTest() {

    //Setup:
    when(engineManager.getUsername(user.getResource())).thenReturn(Optional.of(UsernameTestFilter.USERNAME));
    Response response = target().path("users/username").queryParam("iri", user.getResource())
            .request().get();
    assertEquals(response.getStatus(), 200);
    assertEquals(response.readEntity(String.class), UsernameTestFilter.USERNAME);
}