@Test public void testGetWebServerList() { when(Config.mockWebServerService.getWebServers()).thenReturn(webServerList); final Response response = webServerServiceRest.getWebServers(null); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); final ApplicationResponse applicationResponse = (ApplicationResponse) response.getEntity(); final Object content = applicationResponse.getApplicationResponseContent(); assertTrue(content instanceof List); final List<WebServer> receivedList = (List<WebServer>) content; final WebServer received = receivedList.get(0); assertEquals(webServer, received); final WebServer received2 = receivedList.get(1); assertEquals(webServer2, received2); }
@Override public Response getWebServers(final Identifier<Group> aGroupId) { LOGGER.debug("Get web servers for group {}", aGroupId); final List<WebServer> webServers; if (aGroupId == null) { webServers = webServerService.getWebServers(); return ResponseBuilder.ok(webServers); } webServers = webServerService.findWebServers(aGroupId); return ResponseBuilder.ok(webServers); }
WebServerServiceRestImpl implements WebServerServiceRest { @Override public Response getWebServers(final Identifier<Group> aGroupId) { LOGGER.debug("Get web servers for group {}", aGroupId); final List<WebServer> webServers; if (aGroupId == null) { webServers = webServerService.getWebServers(); return ResponseBuilder.ok(webServers); } webServers = webServerService.findWebServers(aGroupId); return ResponseBuilder.ok(webServers); } }
WebServerServiceRestImpl implements WebServerServiceRest { @Override public Response getWebServers(final Identifier<Group> aGroupId) { LOGGER.debug("Get web servers for group {}", aGroupId); final List<WebServer> webServers; if (aGroupId == null) { webServers = webServerService.getWebServers(); return ResponseBuilder.ok(webServers); } webServers = webServerService.findWebServers(aGroupId); return ResponseBuilder.ok(webServers); } WebServerServiceRestImpl(final WebServerService theWebServerService,
                                    final WebServerControlService theWebServerControlService,
                                    final WebServerCommandService theWebServerCommandService,
                                    final ResourceService theResourceService, GroupService groupService,
                                    final BinaryDistributionService binaryDistributionService,
                                    final HistoryFacadeService historyFacadeService
                                    ); }
WebServerServiceRestImpl implements WebServerServiceRest { @Override public Response getWebServers(final Identifier<Group> aGroupId) { LOGGER.debug("Get web servers for group {}", aGroupId); final List<WebServer> webServers; if (aGroupId == null) { webServers = webServerService.getWebServers(); return ResponseBuilder.ok(webServers); } webServers = webServerService.findWebServers(aGroupId); return ResponseBuilder.ok(webServers); } WebServerServiceRestImpl(final WebServerService theWebServerService,
                                    final WebServerControlService theWebServerControlService,
                                    final WebServerCommandService theWebServerCommandService,
                                    final ResourceService theResourceService, GroupService groupService,
                                    final BinaryDistributionService binaryDistributionService,
                                    final HistoryFacadeService historyFacadeService
                                    ); @Override Response getWebServers(final Identifier<Group> aGroupId); @Override Response getWebServer(final Identifier<WebServer> aWsId); @Override Response createWebServer(final JsonCreateWebServer aWebServerToCreate, final AuthenticatedUser aUser); @Override Response updateWebServer(final JsonUpdateWebServer aWebServerToCreate, final AuthenticatedUser aUser); @Override Response deleteWebServer(final Identifier<WebServer> id, boolean hardDelete, final AuthenticatedUser authUser); @Override Response controlWebServer(final Identifier<WebServer> aWebServerId,
                                     final JsonControlWebServer aWebServerToControl, final AuthenticatedUser aUser,
                                     final Boolean wait, Long waitTimeout); @Override Response generateConfig(final String webServerName); @Override Response generateAndDeployConfig(final String aWebServerName, final String resourceFileName, final AuthenticatedUser user); @Override Response generateAndDeployWebServer(final String aWebServerName, final AuthenticatedUser aUser); @Override Response getHttpdConfig(Identifier<WebServer> aWebServerId); @Override Response getResourceNames(final String wsName); @Override Response getResourceTemplate(final String wsName, final String resourceTemplateName,
                                        final boolean tokensReplaced); @Override Response updateResourceTemplate(final String wsName, final String resourceTemplateName, final String content); @Override Response previewResourceTemplate(final String webServerName, final String fileName, final String groupName, String template); }
WebServerServiceRestImpl implements WebServerServiceRest { @Override public Response getWebServers(final Identifier<Group> aGroupId) { LOGGER.debug("Get web servers for group {}", aGroupId); final List<WebServer> webServers; if (aGroupId == null) { webServers = webServerService.getWebServers(); return ResponseBuilder.ok(webServers); } webServers = webServerService.findWebServers(aGroupId); return ResponseBuilder.ok(webServers); } WebServerServiceRestImpl(final WebServerService theWebServerService,
                                    final WebServerControlService theWebServerControlService,
                                    final WebServerCommandService theWebServerCommandService,
                                    final ResourceService theResourceService, GroupService groupService,
                                    final BinaryDistributionService binaryDistributionService,
                                    final HistoryFacadeService historyFacadeService
                                    ); @Override Response getWebServers(final Identifier<Group> aGroupId); @Override Response getWebServer(final Identifier<WebServer> aWsId); @Override Response createWebServer(final JsonCreateWebServer aWebServerToCreate, final AuthenticatedUser aUser); @Override Response updateWebServer(final JsonUpdateWebServer aWebServerToCreate, final AuthenticatedUser aUser); @Override Response deleteWebServer(final Identifier<WebServer> id, boolean hardDelete, final AuthenticatedUser authUser); @Override Response controlWebServer(final Identifier<WebServer> aWebServerId,
                                     final JsonControlWebServer aWebServerToControl, final AuthenticatedUser aUser,
                                     final Boolean wait, Long waitTimeout); @Override Response generateConfig(final String webServerName); @Override Response generateAndDeployConfig(final String aWebServerName, final String resourceFileName, final AuthenticatedUser user); @Override Response generateAndDeployWebServer(final String aWebServerName, final AuthenticatedUser aUser); @Override Response getHttpdConfig(Identifier<WebServer> aWebServerId); @Override Response getResourceNames(final String wsName); @Override Response getResourceTemplate(final String wsName, final String resourceTemplateName,
                                        final boolean tokensReplaced); @Override Response updateResourceTemplate(final String wsName, final String resourceTemplateName, final String content); @Override Response previewResourceTemplate(final String webServerName, final String fileName, final String groupName, String template);  }