@Test public void serializeWhenSpecificSchemeSerializer() throws Exception { VfsResourceReference reference = new VfsResourceReference( URI.create("attach:attachment"), "path1/path2/test.txt"); ExtendedURL extendedURL = new ExtendedURL(Arrays.asList( "vfs", "attach:wiki:space.page@attachment", "path1", "path2", "test.txt")); when(serializer.serialize(reference)).thenReturn(extendedURL); assertEquals("/vfs/attach%3Awiki%3Aspace.page%40attachment/path1/path2/test.txt", this.vfsResourceReferenceSerializer.serialize(reference).toString()); }
@Override public ExtendedURL serialize(VfsResourceReference resourceReference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { ExtendedURL extendedURL; String scheme = resourceReference.getScheme(); try { ResourceReferenceSerializer<VfsResourceReference, ExtendedURL> schemeSpecificSerializer = this.componentManagerProvider.get().getInstance(TYPE, scheme); extendedURL = schemeSpecificSerializer.serialize(resourceReference); } catch (ComponentLookupException e) { extendedURL = super.serialize(resourceReference); } return extendedURL; }
VfsResourceReferenceSerializer extends AbstractVfsResourceReferenceSerializer { @Override public ExtendedURL serialize(VfsResourceReference resourceReference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { ExtendedURL extendedURL; String scheme = resourceReference.getScheme(); try { ResourceReferenceSerializer<VfsResourceReference, ExtendedURL> schemeSpecificSerializer = this.componentManagerProvider.get().getInstance(TYPE, scheme); extendedURL = schemeSpecificSerializer.serialize(resourceReference); } catch (ComponentLookupException e) { extendedURL = super.serialize(resourceReference); } return extendedURL; } }
VfsResourceReferenceSerializer extends AbstractVfsResourceReferenceSerializer { @Override public ExtendedURL serialize(VfsResourceReference resourceReference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { ExtendedURL extendedURL; String scheme = resourceReference.getScheme(); try { ResourceReferenceSerializer<VfsResourceReference, ExtendedURL> schemeSpecificSerializer = this.componentManagerProvider.get().getInstance(TYPE, scheme); extendedURL = schemeSpecificSerializer.serialize(resourceReference); } catch (ComponentLookupException e) { extendedURL = super.serialize(resourceReference); } return extendedURL; }  }
VfsResourceReferenceSerializer extends AbstractVfsResourceReferenceSerializer { @Override public ExtendedURL serialize(VfsResourceReference resourceReference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { ExtendedURL extendedURL; String scheme = resourceReference.getScheme(); try { ResourceReferenceSerializer<VfsResourceReference, ExtendedURL> schemeSpecificSerializer = this.componentManagerProvider.get().getInstance(TYPE, scheme); extendedURL = schemeSpecificSerializer.serialize(resourceReference); } catch (ComponentLookupException e) { extendedURL = super.serialize(resourceReference); } return extendedURL; }  @Override ExtendedURL serialize(VfsResourceReference resourceReference); }
VfsResourceReferenceSerializer extends AbstractVfsResourceReferenceSerializer { @Override public ExtendedURL serialize(VfsResourceReference resourceReference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { ExtendedURL extendedURL; String scheme = resourceReference.getScheme(); try { ResourceReferenceSerializer<VfsResourceReference, ExtendedURL> schemeSpecificSerializer = this.componentManagerProvider.get().getInstance(TYPE, scheme); extendedURL = schemeSpecificSerializer.serialize(resourceReference); } catch (ComponentLookupException e) { extendedURL = super.serialize(resourceReference); } return extendedURL; }  @Override ExtendedURL serialize(VfsResourceReference resourceReference);  }