BasicClient implements SLIClient { @Override public void read(List<Entity> entities, final String type, final Query query) throws URISyntaxException, MessageProcessingException, IOException, SLIClientException { read(entities, type, null, query); } 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 testRead() throws MessageProcessingException, URISyntaxException, IOException, SLIClientException { Response r = mock(Response.class); when(r.getStatus()).thenReturn(200); when(r.readEntity(String.class)).thenReturn(mapper.writeValueAsString(studentDataWithType)); when(restClient.getRequest(new URL("http: when(restClient.getRequest(new URL("http: assertEquals(Arrays.asList(new GenericEntity(ResourceNames.STUDENTS, studentData)), underTest.read("/students/42")); assertEquals(Arrays.asList(new GenericEntity(ResourceNames.STUDENTS, studentData)), underTest.read("http: List<Entity> studentList = new ArrayList<Entity>(); underTest.read(studentList, ResourceNames.STUDENTS, BasicQuery.Builder.create().maxResults(1).build()); assertEquals(Arrays.asList(new GenericEntity(ResourceNames.STUDENTS, studentData)), studentList); }