@Test public void testGetStoppedWebServersAndJvmsCount() { when(mockGroupService.getGroups()).thenReturn(new ArrayList<>(groups)); when(mockJvmService.getJvmStoppedCount(anyString())).thenReturn(0L); when(mockJvmService.getJvmForciblyStoppedCount(anyString())).thenReturn(0L); when(mockJvmService.getJvmCount(anyString())).thenReturn(1L); when(mockWebServerService.getWebServerStoppedCount(anyString())).thenReturn(0L); when(mockWebServerService.getWebServerCount(anyString())).thenReturn(1L); Response response = groupServiceRest.getStoppedWebServersAndJvmsCount(); assertNotNull(response); response = groupServiceRest.getStoppedWebServersAndJvmsCount("testGroup"); assertNotNull(response); }
@Override public Response getStoppedWebServersAndJvmsCount() { LOGGER.debug("Get stopped Web Servers and JVMs count"); final List<GroupServerInfo> groupServerInfos = new ArrayList<>(groupService.getGroups().size()); for (final Group group : groupService.getGroups()) { final GroupServerInfo groupServerInfo = new GroupServerInfoBuilder().setGroupName(group.getName()) .setJvmStoppedCount(jvmService.getJvmStoppedCount(group.getName())) .setJvmForciblyStoppedCount(jvmService.getJvmForciblyStoppedCount(group.getName())) .setJvmCount(jvmService.getJvmCount(group.getName())) .setWebServerStoppedCount(webServerService.getWebServerStoppedCount(group.getName())) .setWebServerCount(webServerService.getWebServerCount(group.getName())).build(); groupServerInfos.add(groupServerInfo); } return ResponseBuilder.ok(groupServerInfos); }
GroupServiceRestImpl implements GroupServiceRest { @Override public Response getStoppedWebServersAndJvmsCount() { LOGGER.debug("Get stopped Web Servers and JVMs count"); final List<GroupServerInfo> groupServerInfos = new ArrayList<>(groupService.getGroups().size()); for (final Group group : groupService.getGroups()) { final GroupServerInfo groupServerInfo = new GroupServerInfoBuilder().setGroupName(group.getName()) .setJvmStoppedCount(jvmService.getJvmStoppedCount(group.getName())) .setJvmForciblyStoppedCount(jvmService.getJvmForciblyStoppedCount(group.getName())) .setJvmCount(jvmService.getJvmCount(group.getName())) .setWebServerStoppedCount(webServerService.getWebServerStoppedCount(group.getName())) .setWebServerCount(webServerService.getWebServerCount(group.getName())).build(); groupServerInfos.add(groupServerInfo); } return ResponseBuilder.ok(groupServerInfos); } }
GroupServiceRestImpl implements GroupServiceRest { @Override public Response getStoppedWebServersAndJvmsCount() { LOGGER.debug("Get stopped Web Servers and JVMs count"); final List<GroupServerInfo> groupServerInfos = new ArrayList<>(groupService.getGroups().size()); for (final Group group : groupService.getGroups()) { final GroupServerInfo groupServerInfo = new GroupServerInfoBuilder().setGroupName(group.getName()) .setJvmStoppedCount(jvmService.getJvmStoppedCount(group.getName())) .setJvmForciblyStoppedCount(jvmService.getJvmForciblyStoppedCount(group.getName())) .setJvmCount(jvmService.getJvmCount(group.getName())) .setWebServerStoppedCount(webServerService.getWebServerStoppedCount(group.getName())) .setWebServerCount(webServerService.getWebServerCount(group.getName())).build(); groupServerInfos.add(groupServerInfo); } return ResponseBuilder.ok(groupServerInfos); } @Autowired  GroupServiceRestImpl(final GroupService groupService, final ResourceService resourceService,
                                final GroupControlService groupControlService, final GroupJvmControlService groupJvmControlService,
                                final GroupWebServerControlService groupWebServerControlService, final JvmService jvmService,
                                final WebServerService webServerService, ApplicationService applicationService,
                                final ApplicationServiceRest applicationServiceRest, final WebServerServiceRest webServerServiceRest); }
GroupServiceRestImpl implements GroupServiceRest { @Override public Response getStoppedWebServersAndJvmsCount() { LOGGER.debug("Get stopped Web Servers and JVMs count"); final List<GroupServerInfo> groupServerInfos = new ArrayList<>(groupService.getGroups().size()); for (final Group group : groupService.getGroups()) { final GroupServerInfo groupServerInfo = new GroupServerInfoBuilder().setGroupName(group.getName()) .setJvmStoppedCount(jvmService.getJvmStoppedCount(group.getName())) .setJvmForciblyStoppedCount(jvmService.getJvmForciblyStoppedCount(group.getName())) .setJvmCount(jvmService.getJvmCount(group.getName())) .setWebServerStoppedCount(webServerService.getWebServerStoppedCount(group.getName())) .setWebServerCount(webServerService.getWebServerCount(group.getName())).build(); groupServerInfos.add(groupServerInfo); } return ResponseBuilder.ok(groupServerInfos); } @Autowired  GroupServiceRestImpl(final GroupService groupService, final ResourceService resourceService,
                                final GroupControlService groupControlService, final GroupJvmControlService groupJvmControlService,
                                final GroupWebServerControlService groupWebServerControlService, final JvmService jvmService,
                                final WebServerService webServerService, ApplicationService applicationService,
                                final ApplicationServiceRest applicationServiceRest, final WebServerServiceRest webServerServiceRest); @Override Response getGroups(final NameSearchParameterProvider aGroupNameSearch, final boolean fetchWebServers); @Override Response getGroup(final String groupIdOrName, final boolean byName); @Override Response createGroup(final String aNewGroupName,
                                final AuthenticatedUser aUser); @Override Response updateGroup(final JsonUpdateGroup anUpdatedGroup,
                                final AuthenticatedUser aUser); @Override Response removeGroup(final String name, final boolean byName); @Override Response removeJvmFromGroup(final Identifier<Group> aGroupId,
                                       final Identifier<Jvm> aJvmId,
                                       final AuthenticatedUser aUser); @Override Response addJvmsToGroup(final Identifier<Group> aGroupId,
                                   final JsonJvms someJvmsToAdd,
                                   final AuthenticatedUser aUser); @Override Response controlGroupJvms(final Identifier<Group> aGroupId,
                                     final JsonControlJvm jsonControlJvm,
                                     final AuthenticatedUser aUser); @Override Response updateGroupWebServerResourceTemplate(final String groupName, final String resourceTemplateName, final String content); @Override Response previewGroupWebServerResourceTemplate(String groupName, String resourceTemplateName, String template); @Override Response getGroupWebServerResourceTemplate(String groupName, String resourceTemplateName, boolean tokensReplaced); @Override Response generateAndDeployGroupJvmFile(final String groupName, final String fileName,
                                                  final AuthenticatedUser authUser); @Override Response getGroupJvmResourceTemplate(final String groupName,
                                                final String resourceTemplateName,
                                                final boolean tokensReplaced); @Override Response updateGroupJvmResourceTemplate(final String groupName, final String resourceTemplateName, final String content); @Override Response previewGroupJvmResourceTemplate(String groupName, String fileName, String template); @Override Response generateAndDeployGroupWebServersFile(final String groupName, final String resourceFileName, final AuthenticatedUser aUser); @Override Response controlGroupWebservers(final Identifier<Group> aGroupId,
                                           final JsonControlWebServer jsonControlWebServer,
                                           final AuthenticatedUser aUser); @Override Response generateGroupWebservers(Identifier<Group> aGroupId, final AuthenticatedUser aUser); @Override Response generateGroupJvms(final Identifier<Group> aGroupId, final AuthenticatedUser aUser); @Override Response controlGroup(final Identifier<Group> aGroupId,
                                 final JsonControlGroup jsonControlGroup,
                                 final AuthenticatedUser aUser); @Override Response controlGroups(final JsonControlGroup jsonControlGroup, final AuthenticatedUser authenticatedUser); @Override Response getOtherGroupMembershipDetailsOfTheChildren(final Identifier<Group> id,
                                                                final GroupChildType groupChildType); @Override Response getGroupJvmsResourceNames(String groupName); @Override Response getGroupWebServersResourceNames(String groupName); @Override Response updateGroupAppResourceTemplate(final String groupName, final String appName, final String resourceTemplateName, final String content); @Override Response generateAndDeployGroupAppFile(final String groupName, final String fileName, final String appName, final AuthenticatedUser aUser, final String hostName); @Override Response previewGroupAppResourceTemplate(String groupName, String resourceTemplateName, String appName, String template); @Override Response getGroupAppResourceTemplate(String groupName, String appName, String resourceTemplateName, boolean tokensReplaced); @Override Response getGroupAppResourceNames(String groupName); @Override Response getStartedWebServersAndJvmsCount(); @Override Response getStartedAndStoppedWebServersAndJvmsCount(); @Override Response getStartedWebServersAndJvmsCount(final String groupName); @Override Response getStartedAndStoppedWebServersAndJvmsCount(final String groupName); @Override Response getStoppedWebServersAndJvmsCount(); @Override Response getStoppedWebServersAndJvmsCount(final String groupName); @Override Response areAllJvmsStopped(final String groupName); @Override Response areAllWebServersStopped(final String groupName); @Override Response getHosts(final String groupName); @Override Response getAllHosts(); @Override Response getGroupState(final String groupName); @Override Response getGroupStates(); }
GroupServiceRestImpl implements GroupServiceRest { @Override public Response getStoppedWebServersAndJvmsCount() { LOGGER.debug("Get stopped Web Servers and JVMs count"); final List<GroupServerInfo> groupServerInfos = new ArrayList<>(groupService.getGroups().size()); for (final Group group : groupService.getGroups()) { final GroupServerInfo groupServerInfo = new GroupServerInfoBuilder().setGroupName(group.getName()) .setJvmStoppedCount(jvmService.getJvmStoppedCount(group.getName())) .setJvmForciblyStoppedCount(jvmService.getJvmForciblyStoppedCount(group.getName())) .setJvmCount(jvmService.getJvmCount(group.getName())) .setWebServerStoppedCount(webServerService.getWebServerStoppedCount(group.getName())) .setWebServerCount(webServerService.getWebServerCount(group.getName())).build(); groupServerInfos.add(groupServerInfo); } return ResponseBuilder.ok(groupServerInfos); } @Autowired  GroupServiceRestImpl(final GroupService groupService, final ResourceService resourceService,
                                final GroupControlService groupControlService, final GroupJvmControlService groupJvmControlService,
                                final GroupWebServerControlService groupWebServerControlService, final JvmService jvmService,
                                final WebServerService webServerService, ApplicationService applicationService,
                                final ApplicationServiceRest applicationServiceRest, final WebServerServiceRest webServerServiceRest); @Override Response getGroups(final NameSearchParameterProvider aGroupNameSearch, final boolean fetchWebServers); @Override Response getGroup(final String groupIdOrName, final boolean byName); @Override Response createGroup(final String aNewGroupName,
                                final AuthenticatedUser aUser); @Override Response updateGroup(final JsonUpdateGroup anUpdatedGroup,
                                final AuthenticatedUser aUser); @Override Response removeGroup(final String name, final boolean byName); @Override Response removeJvmFromGroup(final Identifier<Group> aGroupId,
                                       final Identifier<Jvm> aJvmId,
                                       final AuthenticatedUser aUser); @Override Response addJvmsToGroup(final Identifier<Group> aGroupId,
                                   final JsonJvms someJvmsToAdd,
                                   final AuthenticatedUser aUser); @Override Response controlGroupJvms(final Identifier<Group> aGroupId,
                                     final JsonControlJvm jsonControlJvm,
                                     final AuthenticatedUser aUser); @Override Response updateGroupWebServerResourceTemplate(final String groupName, final String resourceTemplateName, final String content); @Override Response previewGroupWebServerResourceTemplate(String groupName, String resourceTemplateName, String template); @Override Response getGroupWebServerResourceTemplate(String groupName, String resourceTemplateName, boolean tokensReplaced); @Override Response generateAndDeployGroupJvmFile(final String groupName, final String fileName,
                                                  final AuthenticatedUser authUser); @Override Response getGroupJvmResourceTemplate(final String groupName,
                                                final String resourceTemplateName,
                                                final boolean tokensReplaced); @Override Response updateGroupJvmResourceTemplate(final String groupName, final String resourceTemplateName, final String content); @Override Response previewGroupJvmResourceTemplate(String groupName, String fileName, String template); @Override Response generateAndDeployGroupWebServersFile(final String groupName, final String resourceFileName, final AuthenticatedUser aUser); @Override Response controlGroupWebservers(final Identifier<Group> aGroupId,
                                           final JsonControlWebServer jsonControlWebServer,
                                           final AuthenticatedUser aUser); @Override Response generateGroupWebservers(Identifier<Group> aGroupId, final AuthenticatedUser aUser); @Override Response generateGroupJvms(final Identifier<Group> aGroupId, final AuthenticatedUser aUser); @Override Response controlGroup(final Identifier<Group> aGroupId,
                                 final JsonControlGroup jsonControlGroup,
                                 final AuthenticatedUser aUser); @Override Response controlGroups(final JsonControlGroup jsonControlGroup, final AuthenticatedUser authenticatedUser); @Override Response getOtherGroupMembershipDetailsOfTheChildren(final Identifier<Group> id,
                                                                final GroupChildType groupChildType); @Override Response getGroupJvmsResourceNames(String groupName); @Override Response getGroupWebServersResourceNames(String groupName); @Override Response updateGroupAppResourceTemplate(final String groupName, final String appName, final String resourceTemplateName, final String content); @Override Response generateAndDeployGroupAppFile(final String groupName, final String fileName, final String appName, final AuthenticatedUser aUser, final String hostName); @Override Response previewGroupAppResourceTemplate(String groupName, String resourceTemplateName, String appName, String template); @Override Response getGroupAppResourceTemplate(String groupName, String appName, String resourceTemplateName, boolean tokensReplaced); @Override Response getGroupAppResourceNames(String groupName); @Override Response getStartedWebServersAndJvmsCount(); @Override Response getStartedAndStoppedWebServersAndJvmsCount(); @Override Response getStartedWebServersAndJvmsCount(final String groupName); @Override Response getStartedAndStoppedWebServersAndJvmsCount(final String groupName); @Override Response getStoppedWebServersAndJvmsCount(); @Override Response getStoppedWebServersAndJvmsCount(final String groupName); @Override Response areAllJvmsStopped(final String groupName); @Override Response areAllWebServersStopped(final String groupName); @Override Response getHosts(final String groupName); @Override Response getAllHosts(); @Override Response getGroupState(final String groupName); @Override Response getGroupStates();  }