@Test public void testApiLinks() { String basePath = "/" + API; ApiLinks links = apiMapper.computeApiLinks(basePath, null); assertNotNull(links); assertEquals(basePath, links.getSelf()); assertEquals(basePath + "/metrics", links.getMetrics()); assertEquals(basePath + "/links", links.getLinks()); assertEquals(basePath + "/pages", links.getPages()); assertEquals(basePath + "/picture?", links.getPicture()); assertEquals(basePath + "/background?", links.getBackground()); assertEquals(basePath + "/plans", links.getPlans()); assertEquals(basePath + "/ratings", links.getRatings()); }
public ApiLinks computeApiLinks(String basePath, Date updateDate) { ApiLinks apiLinks = new ApiLinks(); apiLinks.setLinks(basePath + "/links"); apiLinks.setMetrics(basePath + "/metrics"); apiLinks.setPages(basePath + "/pages"); apiLinks.setPlans(basePath + "/plans"); apiLinks.setRatings(basePath + "/ratings"); apiLinks.setSelf(basePath); final String hash = updateDate == null ? "" : String.valueOf(updateDate.getTime()); apiLinks.setPicture(basePath + "/picture?" + hash); apiLinks.setBackground(basePath + "/background?" + hash); return apiLinks; }
ApiMapper { public ApiLinks computeApiLinks(String basePath, Date updateDate) { ApiLinks apiLinks = new ApiLinks(); apiLinks.setLinks(basePath + "/links"); apiLinks.setMetrics(basePath + "/metrics"); apiLinks.setPages(basePath + "/pages"); apiLinks.setPlans(basePath + "/plans"); apiLinks.setRatings(basePath + "/ratings"); apiLinks.setSelf(basePath); final String hash = updateDate == null ? "" : String.valueOf(updateDate.getTime()); apiLinks.setPicture(basePath + "/picture?" + hash); apiLinks.setBackground(basePath + "/background?" + hash); return apiLinks; } }
ApiMapper { public ApiLinks computeApiLinks(String basePath, Date updateDate) { ApiLinks apiLinks = new ApiLinks(); apiLinks.setLinks(basePath + "/links"); apiLinks.setMetrics(basePath + "/metrics"); apiLinks.setPages(basePath + "/pages"); apiLinks.setPlans(basePath + "/plans"); apiLinks.setRatings(basePath + "/ratings"); apiLinks.setSelf(basePath); final String hash = updateDate == null ? "" : String.valueOf(updateDate.getTime()); apiLinks.setPicture(basePath + "/picture?" + hash); apiLinks.setBackground(basePath + "/background?" + hash); return apiLinks; }  }
ApiMapper { public ApiLinks computeApiLinks(String basePath, Date updateDate) { ApiLinks apiLinks = new ApiLinks(); apiLinks.setLinks(basePath + "/links"); apiLinks.setMetrics(basePath + "/metrics"); apiLinks.setPages(basePath + "/pages"); apiLinks.setPlans(basePath + "/plans"); apiLinks.setRatings(basePath + "/ratings"); apiLinks.setSelf(basePath); final String hash = updateDate == null ? "" : String.valueOf(updateDate.getTime()); apiLinks.setPicture(basePath + "/picture?" + hash); apiLinks.setBackground(basePath + "/background?" + hash); return apiLinks; }  Api convert(ApiEntity api); ApiLinks computeApiLinks(String basePath, Date updateDate); }
ApiMapper { public ApiLinks computeApiLinks(String basePath, Date updateDate) { ApiLinks apiLinks = new ApiLinks(); apiLinks.setLinks(basePath + "/links"); apiLinks.setMetrics(basePath + "/metrics"); apiLinks.setPages(basePath + "/pages"); apiLinks.setPlans(basePath + "/plans"); apiLinks.setRatings(basePath + "/ratings"); apiLinks.setSelf(basePath); final String hash = updateDate == null ? "" : String.valueOf(updateDate.getTime()); apiLinks.setPicture(basePath + "/picture?" + hash); apiLinks.setBackground(basePath + "/background?" + hash); return apiLinks; }  Api convert(ApiEntity api); ApiLinks computeApiLinks(String basePath, Date updateDate);  }