@Test public void testFetchResourcePassesOnToSuccessor() { ResourceIdentifier.Builder resourceIdentifierBuilder = new ResourceIdentifier.Builder(); resourceIdentifierBuilder.setGroupName("test-group-name"); resourceIdentifierBuilder.setWebAppName("test-app-name"); resourceIdentifierBuilder.setJvmName(null); resourceIdentifierBuilder.setWebServerName(null); resourceIdentifierBuilder.setResourceName("external.properties"); ConfigTemplate mockResourceConfigTemplate = mock(JpaResourceConfigTemplate.class); when(mockSuccessor.fetchResource(any(ResourceIdentifier.class))).thenReturn(mockResourceConfigTemplate); final ResourceIdentifier resourceId = resourceIdentifierBuilder.build(); externalPropertiesResourceHandler.fetchResource(resourceId); verify(mockSuccessor).fetchResource(eq(resourceId)); }
@Override public ConfigTemplate fetchResource(ResourceIdentifier resourceIdentifier) { ConfigTemplate configTemplate = null; if (canHandle(resourceIdentifier)) { configTemplate = resourceDao.getExternalPropertiesResource(resourceIdentifier.resourceName); } else if (successor != null) { configTemplate = successor.fetchResource(resourceIdentifier); } return configTemplate; }
ExternalPropertiesResourceHandler extends ResourceHandler { @Override public ConfigTemplate fetchResource(ResourceIdentifier resourceIdentifier) { ConfigTemplate configTemplate = null; if (canHandle(resourceIdentifier)) { configTemplate = resourceDao.getExternalPropertiesResource(resourceIdentifier.resourceName); } else if (successor != null) { configTemplate = successor.fetchResource(resourceIdentifier); } return configTemplate; } }
ExternalPropertiesResourceHandler extends ResourceHandler { @Override public ConfigTemplate fetchResource(ResourceIdentifier resourceIdentifier) { ConfigTemplate configTemplate = null; if (canHandle(resourceIdentifier)) { configTemplate = resourceDao.getExternalPropertiesResource(resourceIdentifier.resourceName); } else if (successor != null) { configTemplate = successor.fetchResource(resourceIdentifier); } return configTemplate; } ExternalPropertiesResourceHandler(final ResourceDao resourceDao, final ResourceHandler successor); }
ExternalPropertiesResourceHandler extends ResourceHandler { @Override public ConfigTemplate fetchResource(ResourceIdentifier resourceIdentifier) { ConfigTemplate configTemplate = null; if (canHandle(resourceIdentifier)) { configTemplate = resourceDao.getExternalPropertiesResource(resourceIdentifier.resourceName); } else if (successor != null) { configTemplate = successor.fetchResource(resourceIdentifier); } return configTemplate; } ExternalPropertiesResourceHandler(final ResourceDao resourceDao, final ResourceHandler successor); @Override ConfigTemplate fetchResource(ResourceIdentifier resourceIdentifier); @Override CreateResourceResponseWrapper createResource(final ResourceIdentifier resourceIdentifier,
                                                        final ResourceTemplateMetaData metaData,
                                                        final String templateContent); @Override void deleteResource(ResourceIdentifier resourceIdentifier); @Override String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier); }
ExternalPropertiesResourceHandler extends ResourceHandler { @Override public ConfigTemplate fetchResource(ResourceIdentifier resourceIdentifier) { ConfigTemplate configTemplate = null; if (canHandle(resourceIdentifier)) { configTemplate = resourceDao.getExternalPropertiesResource(resourceIdentifier.resourceName); } else if (successor != null) { configTemplate = successor.fetchResource(resourceIdentifier); } return configTemplate; } ExternalPropertiesResourceHandler(final ResourceDao resourceDao, final ResourceHandler successor); @Override ConfigTemplate fetchResource(ResourceIdentifier resourceIdentifier); @Override CreateResourceResponseWrapper createResource(final ResourceIdentifier resourceIdentifier,
                                                        final ResourceTemplateMetaData metaData,
                                                        final String templateContent); @Override void deleteResource(ResourceIdentifier resourceIdentifier); @Override String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier);  }