@Test public void serializeWhenNoMatchingSerializer() throws Exception { TestResourceReference resource = new TestResourceReference(); ComponentManager componentManager = this.mocker.getInstance(ComponentManager.class, "context"); when(componentManager.getInstance(new DefaultParameterizedType(null, ResourceReferenceSerializer.class, TestResourceReference.class, ExtendedURL.class), "standard")).thenThrow( new ComponentLookupException("error")); when(componentManager.getInstance(new DefaultParameterizedType(null, ResourceReferenceSerializer.class, TestResourceReference.class, ExtendedURL.class))).thenThrow( new ComponentLookupException("error")); try { this.mocker.getComponentUnderTest().serialize(resource); fail("Should have thrown an exception here"); } catch (UnsupportedResourceReferenceException expected) { assertEquals("Failed to find serializer for Resource Reference [type = [test], parameters = []] and " + "URL format [standard]", expected.getMessage()); } }
@Override public ExtendedURL serialize(ResourceReference reference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { return serialize(reference, "standard"); }
StandardExtendedURLResourceReferenceSerializer extends AbstractExtendedURLResourceReferenceSerializer { @Override public ExtendedURL serialize(ResourceReference reference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { return serialize(reference, "standard"); } }
StandardExtendedURLResourceReferenceSerializer extends AbstractExtendedURLResourceReferenceSerializer { @Override public ExtendedURL serialize(ResourceReference reference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { return serialize(reference, "standard"); }  }
StandardExtendedURLResourceReferenceSerializer extends AbstractExtendedURLResourceReferenceSerializer { @Override public ExtendedURL serialize(ResourceReference reference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { return serialize(reference, "standard"); }  @Override ExtendedURL serialize(ResourceReference reference); }
StandardExtendedURLResourceReferenceSerializer extends AbstractExtendedURLResourceReferenceSerializer { @Override public ExtendedURL serialize(ResourceReference reference) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException { return serialize(reference, "standard"); }  @Override ExtendedURL serialize(ResourceReference reference);  }