@Test public void resolve() throws CreateResourceReferenceException, UnsupportedResourceReferenceException { ExtendedURL extendedURL = new ExtendedURL(Arrays.asList("foo", "bar"), Collections.singletonMap("customValue", Arrays.asList("baz"))); JCaptchaResourceReference expectedReference = new JCaptchaResourceReference("foo", "bar"); expectedReference.addParameter("customValue", "baz"); assertEquals(expectedReference, jCaptchaResourceReferenceResolver.resolve(extendedURL, JCaptchaResourceReference.TYPE, Collections.emptyMap())); }
@Override public ResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { JCaptchaResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String type = segments.get(0); String engine = segments.get(1); reference = new JCaptchaResourceReference(type, engine); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid JCaptcha URL format [%s]", extendedURL.toString())); } return reference; }
JCaptchaResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public ResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { JCaptchaResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String type = segments.get(0); String engine = segments.get(1); reference = new JCaptchaResourceReference(type, engine); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid JCaptcha URL format [%s]", extendedURL.toString())); } return reference; } }
JCaptchaResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public ResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { JCaptchaResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String type = segments.get(0); String engine = segments.get(1); reference = new JCaptchaResourceReference(type, engine); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid JCaptcha URL format [%s]", extendedURL.toString())); } return reference; }  }
JCaptchaResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public ResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { JCaptchaResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String type = segments.get(0); String engine = segments.get(1); reference = new JCaptchaResourceReference(type, engine); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid JCaptcha URL format [%s]", extendedURL.toString())); } return reference; }  @Override ResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType,
        Map<String, Object> parameters); }
JCaptchaResourceReferenceResolver extends AbstractResourceReferenceResolver { @Override public ResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType, Map<String, Object> parameters) throws CreateResourceReferenceException, UnsupportedResourceReferenceException { JCaptchaResourceReference reference; List<String> segments = extendedURL.getSegments(); if (segments.size() > 1) { String type = segments.get(0); String engine = segments.get(1); reference = new JCaptchaResourceReference(type, engine); copyParameters(extendedURL, reference); } else { throw new CreateResourceReferenceException(String.format("Invalid JCaptcha URL format [%s]", extendedURL.toString())); } return reference; }  @Override ResourceReference resolve(ExtendedURL extendedURL, ResourceType resourceType,
        Map<String, Object> parameters);  }