@Test
public void shouldFailNameValidationWhenNameAlreadyExists() throws Exception {

    // create a data service first
    createDataservice( DATASERVICE_NAME );
    // try and validate the same name of an existing data service
    final URI dsUri = _uriBuilder.workspaceDataservicesUri();
    final URI uri = UriBuilder.fromUri( dsUri )
                              .path( V1Constants.NAME_VALIDATION_SEGMENT )
                              .path( DATASERVICE_NAME )
                              .build();
    final ClientRequest request = request( uri, MediaType.TEXT_PLAIN_TYPE );
    final ClientResponse< String > response = request.get( String.class );
    assertThat( response.getStatus(), is( Response.Status.OK.getStatusCode() ) );
    final String errorMsg = response.getEntity();
    assertThat( errorMsg, is( notNullValue() ) );
}