RemoteServiceDescriptor { public List<Link> getLinks() throws ServerException, IOException { final List<Link> links = getServiceDescriptor().getLinks(); final List<Link> copy = new ArrayList<>(links.size()); for (Link link : links) { copy.add(DtoFactory.getInstance().clone(link)); } return copy; } RemoteServiceDescriptor(String baseUrl, HttpJsonRequestFactory requestFactory); String getBaseUrl(); List<Link> getLinks(); Link getLink(String rel); ServiceDescriptor getServiceDescriptor(); boolean isAvailable();  }
@Test public void shouldBeAbleToReturnLinks() throws Exception { remoteServiceDescriptor = new RemoteServiceDescriptor(serverUrl + SERVICE_PATH, requestFactory); final List<Link> links = remoteServiceDescriptor.getLinks(); assertEquals(links.size(), 1); assertEquals(links.get(0).getMethod(), HttpMethod.GET); assertEquals(links.get(0).getHref(), serverUrl + SERVICE_PATH + "/my_method"); assertEquals(links.get(0).getProduces(), MediaType.TEXT_PLAIN); }