@Test public void serialize() throws UnsupportedResourceReferenceException, SerializeResourceReferenceException { JCaptchaResourceReference jCaptchaResourceReference = new JCaptchaResourceReference("fooType", "barEngine"); ExtendedURL extendedURL = jCaptchaResourceReferenceSerializer.serialize(jCaptchaResourceReference); verify(extendedURLNormalizer, times(1)).normalize(any()); List<String> segments = extendedURL.getSegments(); assertEquals(3, segments.size()); assertEquals("jcaptcha", segments.get(0)); assertEquals("fooType", segments.get(1)); assertEquals("barEngine", segments.get(2)); assertTrue(extendedURL.getParameters().isEmpty()); }
@Override public ExtendedURL serialize(JCaptchaResourceReference resource) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { List<String> segments = new ArrayList<>(); segments.add("jcaptcha"); segments.add(resource.getCaptchaType()); segments.add(resource.getEngine()); ExtendedURL extendedURL = new ExtendedURL(segments, resource.getParameters()); return this.extendedURLNormalizer.normalize(extendedURL); }
JCaptchaResourceReferenceSerializer implements
    ResourceReferenceSerializer<JCaptchaResourceReference, ExtendedURL> { @Override public ExtendedURL serialize(JCaptchaResourceReference resource) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { List<String> segments = new ArrayList<>(); segments.add("jcaptcha"); segments.add(resource.getCaptchaType()); segments.add(resource.getEngine()); ExtendedURL extendedURL = new ExtendedURL(segments, resource.getParameters()); return this.extendedURLNormalizer.normalize(extendedURL); } }
JCaptchaResourceReferenceSerializer implements
    ResourceReferenceSerializer<JCaptchaResourceReference, ExtendedURL> { @Override public ExtendedURL serialize(JCaptchaResourceReference resource) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { List<String> segments = new ArrayList<>(); segments.add("jcaptcha"); segments.add(resource.getCaptchaType()); segments.add(resource.getEngine()); ExtendedURL extendedURL = new ExtendedURL(segments, resource.getParameters()); return this.extendedURLNormalizer.normalize(extendedURL); }  }
JCaptchaResourceReferenceSerializer implements
    ResourceReferenceSerializer<JCaptchaResourceReference, ExtendedURL> { @Override public ExtendedURL serialize(JCaptchaResourceReference resource) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { List<String> segments = new ArrayList<>(); segments.add("jcaptcha"); segments.add(resource.getCaptchaType()); segments.add(resource.getEngine()); ExtendedURL extendedURL = new ExtendedURL(segments, resource.getParameters()); return this.extendedURLNormalizer.normalize(extendedURL); }  @Override ExtendedURL serialize(JCaptchaResourceReference resource); }
JCaptchaResourceReferenceSerializer implements
    ResourceReferenceSerializer<JCaptchaResourceReference, ExtendedURL> { @Override public ExtendedURL serialize(JCaptchaResourceReference resource) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { List<String> segments = new ArrayList<>(); segments.add("jcaptcha"); segments.add(resource.getCaptchaType()); segments.add(resource.getEngine()); ExtendedURL extendedURL = new ExtendedURL(segments, resource.getParameters()); return this.extendedURLNormalizer.normalize(extendedURL); }  @Override ExtendedURL serialize(JCaptchaResourceReference resource);  }