Api2UrlService { public String getPortalBaseUrl() { if (StringUtils.isEmpty(portalBaseUrl)) { return EuropeanaStaticUrl.EUROPEANA_PORTAL_URL; } return portalBaseUrl; } Api2UrlService(String portalBaseUrl, String api2BaseUrl, String apikeyValidateUrl, String apiGatewayBaseUrl); static Api2UrlService getBeanInstance(); String getPortalBaseUrl(); String getApi2BaseUrl(); String getApikeyValidateUrl(); String getRecordPortalUrl(String collectionId, String itemId); String getApiGatewayBaseUrl(); String getRecordPortalUrl(String europeanaId); @Deprecated String getRecordResolveUrl(String europeanaId); String getRecordApi2Url(String collectionId, String itemId, String wskey); String getRecordApi2Url(String europeanaId, String wskey); String getThumbnailUrl(String uri, String type); String getThumbnailUrl(String uri, String size, String type); @Deprecated String getRedirectUrl(String wskey, String isShownAtUri, String provider, String europeanaId, String profile); static final String API_BASEURL; }
@Test public void testGetPortalBaseUrl() { String baseUrl = null; Api2UrlService s1 = new Api2UrlService(baseUrl,null, null, null); assertEquals(EuropeanaStaticUrl.EUROPEANA_PORTAL_URL, s1.getPortalBaseUrl()); baseUrl = "www.europeana.eu"; Api2UrlService s2 = new Api2UrlService(baseUrl, null, null, null); assertEquals(baseUrl, s2.getPortalBaseUrl()); baseUrl = "http: Api2UrlService s3 = new Api2UrlService(baseUrl,null, null, null); assertEquals(baseUrl, s3.getPortalBaseUrl()); }