BasicClient implements SLIClient { @Override public void update(final Entity e) throws URISyntaxException, MessageProcessingException, IOException, SLIClientException { URL url = URLBuilder.create(restClient.getBaseURL()).entityType(e.getEntityType()).id(e.getId()).build(); Response response = restClient.putRequest(url, mapper.writeValueAsString(e)); checkResponse(response, Status.NO_CONTENT, "Unable to update 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 testUpdate() throws URISyntaxException, IOException, MessageProcessingException, SLIClientException { Entity e = new GenericEntity(ResourceNames.STUDENTS, studentData); Response r = mock(Response.class); when(r.getStatus()).thenReturn(204); when(restClient.putRequest(any(URL.class), anyString())).thenReturn(r); underTest.update(e); verify(restClient).putRequest(new URL("http: }