BasicClient implements SLIClient { @Override public void delete(final String entityType, final String entityId) throws MalformedURLException, URISyntaxException, SLIClientException { URL url = URLBuilder.create(restClient.getBaseURL()).entityType(entityType).id(entityId).build(); checkResponse(restClient.deleteRequest(url), Status.NO_CONTENT, "Could not delete entity."); } BasicClient(final RESTClient restClient); @Override String create(final Entity e); @Override String create(final Entity e, String resourceUrl); @Override void read(List<Entity> entities, final String type, final Query query); @Override void read(final List<Entity> entities, final String type, final String id, final Query query); @Override List<Entity> read(final String resourceUrl, Query query); @Override List<Entity> read(final String resourceUrl); @Override void update(final Entity e); @Override void delete(final String entityType, final String entityId); @Override void delete(Entity e); Response getResource(final List<Entity> entities, URL resourceURL, Query query); @Override Response getHomeResource(Entity home); String sessionCheck(final String token); @Override RESTClient getRESTClient();  }
@Test public void testDelete() throws MalformedURLException, URISyntaxException, SLIClientException { Entity e = new GenericEntity(ResourceNames.STUDENTS, studentData); Response r = mock(Response.class); when(r.getStatus()).thenReturn(204); when(restClient.deleteRequest(any(URL.class))).thenReturn(r); underTest.delete(e); underTest.delete(ResourceNames.STUDENTS, "42"); verify(restClient, times(2)).deleteRequest(new URL("http: }