@Test public void testGetSelectedValue() { WebServer mockWebServer = mock(WebServer.class); when(mockWebServerPersistence.findWebServerByName(anyString())).thenReturn(mockWebServer); WebServer webServer = (WebServer) webServerResourceHandler.getSelectedValue(resourceIdentifier); assertEquals(mockWebServer, webServer); }
@Override public Object getSelectedValue(ResourceIdentifier resourceIdentifier) { if (canHandle(resourceIdentifier)){ return webServerPersistenceService.findWebServerByName(resourceIdentifier.webServerName); } else { return successor.getSelectedValue(resourceIdentifier); } }
WebServerResourceHandler extends ResourceHandler { @Override public Object getSelectedValue(ResourceIdentifier resourceIdentifier) { if (canHandle(resourceIdentifier)){ return webServerPersistenceService.findWebServerByName(resourceIdentifier.webServerName); } else { return successor.getSelectedValue(resourceIdentifier); } } }
WebServerResourceHandler extends ResourceHandler { @Override public Object getSelectedValue(ResourceIdentifier resourceIdentifier) { if (canHandle(resourceIdentifier)){ return webServerPersistenceService.findWebServerByName(resourceIdentifier.webServerName); } else { return successor.getSelectedValue(resourceIdentifier); } } WebServerResourceHandler(final ResourceDao resourceDao,
                                    final WebServerPersistenceService webServerPersistenceService,
                                    final ResourceContentGeneratorService resourceContentGeneratorService,
                                    final ResourceHandler successor); }
WebServerResourceHandler extends ResourceHandler { @Override public Object getSelectedValue(ResourceIdentifier resourceIdentifier) { if (canHandle(resourceIdentifier)){ return webServerPersistenceService.findWebServerByName(resourceIdentifier.webServerName); } else { return successor.getSelectedValue(resourceIdentifier); } } WebServerResourceHandler(final ResourceDao resourceDao,
                                    final WebServerPersistenceService webServerPersistenceService,
                                    final ResourceContentGeneratorService resourceContentGeneratorService,
                                    final ResourceHandler successor); @Override ConfigTemplate fetchResource(final ResourceIdentifier resourceIdentifier); @Override CreateResourceResponseWrapper createResource(final ResourceIdentifier resourceIdentifier,
                                                        final ResourceTemplateMetaData metaData,
                                                        final String templateContent); @Override void deleteResource(final ResourceIdentifier resourceIdentifier); @Override String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier); }
WebServerResourceHandler extends ResourceHandler { @Override public Object getSelectedValue(ResourceIdentifier resourceIdentifier) { if (canHandle(resourceIdentifier)){ return webServerPersistenceService.findWebServerByName(resourceIdentifier.webServerName); } else { return successor.getSelectedValue(resourceIdentifier); } } WebServerResourceHandler(final ResourceDao resourceDao,
                                    final WebServerPersistenceService webServerPersistenceService,
                                    final ResourceContentGeneratorService resourceContentGeneratorService,
                                    final ResourceHandler successor); @Override ConfigTemplate fetchResource(final ResourceIdentifier resourceIdentifier); @Override CreateResourceResponseWrapper createResource(final ResourceIdentifier resourceIdentifier,
                                                        final ResourceTemplateMetaData metaData,
                                                        final String templateContent); @Override void deleteResource(final ResourceIdentifier resourceIdentifier); @Override String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier);  }