@Test public void retrieveSubjectsFailure() throws Exception { ResponseBody errorBody = ResponseBody.create(MediaType.parse(""), "FAIL"); Response<List<Subject>> response = Response.error(400, errorBody); @SuppressWarnings("unchecked") Call<List<Subject>> responseCall = mock(Call.class); doReturn(response).when(responseCall).execute(); doReturn(request).when(responseCall).request(); doReturn(responseCall).when(svc).getSubjects(any(), any()); List<Subject> subjects = refocus.getSubjects(fields); assertThat(subjects.size(), equalTo(0)); }
public List<Subject> getSubjects(List<String> fields) throws UnauthorizedException { return executeAndRetrieveBody(svc().getSubjects(authorizationHeader(), fields), emptyList()); }
RefocusClient extends AbstractRemoteClient<RefocusService> { public List<Subject> getSubjects(List<String> fields) throws UnauthorizedException { return executeAndRetrieveBody(svc().getSubjects(authorizationHeader(), fields), emptyList()); } }
RefocusClient extends AbstractRemoteClient<RefocusService> { public List<Subject> getSubjects(List<String> fields) throws UnauthorizedException { return executeAndRetrieveBody(svc().getSubjects(authorizationHeader(), fields), emptyList()); } RefocusClient(EndpointConnector connector); }
RefocusClient extends AbstractRemoteClient<RefocusService> { public List<Subject> getSubjects(List<String> fields) throws UnauthorizedException { return executeAndRetrieveBody(svc().getSubjects(authorizationHeader(), fields), emptyList()); } RefocusClient(EndpointConnector connector); @Override boolean isAuthenticated(); Sample getSample(String key, List<String> fields); List<Sample> getSamples(String name); boolean upsertSamplesBulk(List<Sample> samples); Sample deleteSample(String key); List<Subject> getSubjects(List<String> fields); Subject getSubject(String key, List<String> fields); Subject getSubjectHierarchy(String key, String status); Subject postSubject(Subject subject); Subject patchSubject(Subject subject); Subject putSubject(Subject subject); Subject deleteSubject(String subjectKey); List<Aspect> getAspects(List<String> fields); Aspect getAspect(String key, List<String> fields); Aspect postAspect(Aspect aspect); Aspect patchAspect(Aspect aspect); }
RefocusClient extends AbstractRemoteClient<RefocusService> { public List<Subject> getSubjects(List<String> fields) throws UnauthorizedException { return executeAndRetrieveBody(svc().getSubjects(authorizationHeader(), fields), emptyList()); } RefocusClient(EndpointConnector connector); @Override boolean isAuthenticated(); Sample getSample(String key, List<String> fields); List<Sample> getSamples(String name); boolean upsertSamplesBulk(List<Sample> samples); Sample deleteSample(String key); List<Subject> getSubjects(List<String> fields); Subject getSubject(String key, List<String> fields); Subject getSubjectHierarchy(String key, String status); Subject postSubject(Subject subject); Subject patchSubject(Subject subject); Subject putSubject(Subject subject); Subject deleteSubject(String subjectKey); List<Aspect> getAspects(List<String> fields); Aspect getAspect(String key, List<String> fields); Aspect postAspect(Aspect aspect); Aspect patchAspect(Aspect aspect);  }