@Test public void resolve() throws Exception { Map<String, List<String>> parameters = new HashMap<>(); parameters.put("key1", Arrays.asList("value1")); parameters.put("key2", Arrays.asList("value2", "value3")); ExtendedURL extendedURL = new ExtendedURL(Arrays.asList("namespace", "one", "two"), parameters); WebJarsResourceReference reference = this.mocker.getComponentUnderTest().resolve(extendedURL, WebJarsResourceReference.TYPE, Collections.<String, Object>emptyMap()); assertEquals("namespace", reference.getNamespace()); assertEquals("one/two", reference.getResourceName()); assertEquals("value1", reference.getParameterValue("key1")); assertEquals(Arrays.asList("value2", "value3"), reference.getParameterValues("key2")); }
@Override public WebJarsResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { WebJarsResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String namespace = segments.get(0); List<String> resourceSegments = segments.subList(1, segments.size()); reference = new WebJarsResourceReference(namespace, resourceSegments); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid WebJars URL format [%s]", extendedURL.toString())); } return reference; }
WebJarsResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public WebJarsResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { WebJarsResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String namespace = segments.get(0); List<String> resourceSegments = segments.subList(1, segments.size()); reference = new WebJarsResourceReference(namespace, resourceSegments); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid WebJars URL format [%s]", extendedURL.toString())); } return reference; } }
WebJarsResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public WebJarsResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { WebJarsResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String namespace = segments.get(0); List<String> resourceSegments = segments.subList(1, segments.size()); reference = new WebJarsResourceReference(namespace, resourceSegments); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid WebJars URL format [%s]", extendedURL.toString())); } return reference; }  }
WebJarsResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public WebJarsResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { WebJarsResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String namespace = segments.get(0); List<String> resourceSegments = segments.subList(1, segments.size()); reference = new WebJarsResourceReference(namespace, resourceSegments); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid WebJars URL format [%s]", extendedURL.toString())); } return reference; }  @Override WebJarsResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType,
        Map<String, Object> parameters); }
WebJarsResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public WebJarsResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { WebJarsResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String namespace = segments.get(0); List<String> resourceSegments = segments.subList(1, segments.size()); reference = new WebJarsResourceReference(namespace, resourceSegments); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid WebJars URL format [%s]", extendedURL.toString())); } return reference; }  @Override WebJarsResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType,
        Map<String, Object> parameters);  }