@Test public void testBaseIsCorrectlySetWhenResolving() { final String path = "/some/relative/path?foo=bar&baz=blub#fragment"; final String uri = "http: assertThat(client.resolveAgainstBase(uri).toString()).isEqualTo(BASE_REST_URI + path); }
protected URI resolveAgainstBase(String uri) { URI base = getClientConfig().getBaseURI(); URI source = URI.create(uri); String path = resolvePath(base, source); try { return new URI(base.getScheme(), base.getAuthority(), path, source.getQuery(), source.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid URI to resolve: " + uri); } }
SW360Client { protected URI resolveAgainstBase(String uri) { URI base = getClientConfig().getBaseURI(); URI source = URI.create(uri); String path = resolvePath(base, source); try { return new URI(base.getScheme(), base.getAuthority(), path, source.getQuery(), source.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid URI to resolve: " + uri); } } }
SW360Client { protected URI resolveAgainstBase(String uri) { URI base = getClientConfig().getBaseURI(); URI source = URI.create(uri); String path = resolvePath(base, source); try { return new URI(base.getScheme(), base.getAuthority(), path, source.getQuery(), source.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid URI to resolve: " + uri); } } protected  SW360Client(SW360ClientConfig config, AccessTokenProvider tokenProvider); }
SW360Client { protected URI resolveAgainstBase(String uri) { URI base = getClientConfig().getBaseURI(); URI source = URI.create(uri); String path = resolvePath(base, source); try { return new URI(base.getScheme(), base.getAuthority(), path, source.getQuery(), source.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid URI to resolve: " + uri); } } protected  SW360Client(SW360ClientConfig config, AccessTokenProvider tokenProvider); SW360ClientConfig getClientConfig(); AccessTokenProvider getTokenProvider(); }
SW360Client { protected URI resolveAgainstBase(String uri) { URI base = getClientConfig().getBaseURI(); URI source = URI.create(uri); String path = resolvePath(base, source); try { return new URI(base.getScheme(), base.getAuthority(), path, source.getQuery(), source.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid URI to resolve: " + uri); } } protected  SW360Client(SW360ClientConfig config, AccessTokenProvider tokenProvider); SW360ClientConfig getClientConfig(); AccessTokenProvider getTokenProvider();  }