@Test
public void testAdd() throws IllegalArgumentException, URISyntaxException {

    UriBuilder uriBuilder = new UriBuilderImpl(new URI(RESOURCE_PATH));
    when(uriInfo.getRequestUriBuilder()).thenReturn(uriBuilder);
    
    Response resp = taskRes.addTask(task1);
    
    verify(taskService).addOrUpdate(task1);
    assertThat(resp.getStatus(), equalTo(201));
    URI expectedRedirect = new URI(RESOURCE_PATH + "/1");
    assertThat(resp.getHeaders().get("Location"), contains(expectedRedirect));
}