@Test public void getSubject() throws Exception { Subject subject = ImmutableSubject.builder() .from(this.subject) .isPublished(Boolean.FALSE) .build(); Response<Subject> response = Response.success(subject); @SuppressWarnings("unchecked") Call<Subject> responseCall = mock(Call.class); doReturn(response).when(responseCall).execute(); doReturn(request).when(responseCall).request(); doReturn(responseCall).when(svc).getSubject(any(), anyString(), anyList()); Subject result = refocus.getSubject(subject.id(), Collections.emptyList()); assertThat(result, is(not(nullValue()))); assertThat(result.name(), equalTo("name")); assertThat(result.absolutePath(), is(nullValue())); }
public Subject getSubject(String key, List<String> fields) throws UnauthorizedException { Preconditions.checkNotNull(key, "Key should not be null"); return executeAndRetrieveBody(svc().getSubject(authorizationHeader(), key, fields), null); }
RefocusClient extends AbstractRemoteClient<RefocusService> { public Subject getSubject(String key, List<String> fields) throws UnauthorizedException { Preconditions.checkNotNull(key, "Key should not be null"); return executeAndRetrieveBody(svc().getSubject(authorizationHeader(), key, fields), null); } }
RefocusClient extends AbstractRemoteClient<RefocusService> { public Subject getSubject(String key, List<String> fields) throws UnauthorizedException { Preconditions.checkNotNull(key, "Key should not be null"); return executeAndRetrieveBody(svc().getSubject(authorizationHeader(), key, fields), null); } RefocusClient(EndpointConnector connector); }
RefocusClient extends AbstractRemoteClient<RefocusService> { public Subject getSubject(String key, List<String> fields) throws UnauthorizedException { Preconditions.checkNotNull(key, "Key should not be null"); return executeAndRetrieveBody(svc().getSubject(authorizationHeader(), key, fields), null); } 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 Subject getSubject(String key, List<String> fields) throws UnauthorizedException { Preconditions.checkNotNull(key, "Key should not be null"); return executeAndRetrieveBody(svc().getSubject(authorizationHeader(), key, fields), null); } 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);  }