@Test
public void shouldCloneDataservice() throws Exception {

    createDataservice(DATASERVICE_NAME);
    URI dataservicesUri = _uriBuilder.workspaceDataservicesUri();
    final URI uri = UriBuilder.fromUri( dataservicesUri )
                              .path( V1Constants.CLONE_SEGMENT )
                              .path( DATASERVICE_NAME )
                              .build();
    ClientRequest request = request(uri, MediaType.APPLICATION_JSON_TYPE);
    addJsonConsumeContentType(request);
    addBody(request, "newDataservice");
    ClientResponse<String> response = request.post(String.class);
    final String entity = response.getEntity();
    assertThat(entity, is(notNullValue()));
    RestDataservice dataservice = KomodoJsonMarshaller.unmarshall(entity, RestDataservice.class);
    assertNotNull(dataservice);
    
    assertEquals(dataservice.getId(), "newDataservice");
}