@Test public void testControlGroup() { when(mockWebServer.getStateLabel()).thenReturn(WebServerReachableState.WS_REACHABLE.toStateLabel()); cut.controlGroup(controlGroupWebServerRequest, testUser); }
@Transactional @Override public void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser) { controlGroupWebServerRequest.validate(); Group group = groupService.getGroupWithWebServers(controlGroupWebServerRequest.getGroupId()); final Set<WebServer> webServers = group.getWebServers(); if (webServers != null) { controlWebServers(controlGroupWebServerRequest, aUser, webServers); } }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { @Transactional @Override public void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser) { controlGroupWebServerRequest.validate(); Group group = groupService.getGroupWithWebServers(controlGroupWebServerRequest.getGroupId()); final Set<WebServer> webServers = group.getWebServers(); if (webServers != null) { controlWebServers(controlGroupWebServerRequest, aUser, webServers); } } }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { @Transactional @Override public void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser) { controlGroupWebServerRequest.validate(); Group group = groupService.getGroupWithWebServers(controlGroupWebServerRequest.getGroupId()); final Set<WebServer> webServers = group.getWebServers(); if (webServers != null) { controlWebServers(controlGroupWebServerRequest, aUser, webServers); } } GroupWebServerControlServiceImpl(final GroupService theGroupService, WebServerControlService theWebServerControlService); }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { @Transactional @Override public void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser) { controlGroupWebServerRequest.validate(); Group group = groupService.getGroupWithWebServers(controlGroupWebServerRequest.getGroupId()); final Set<WebServer> webServers = group.getWebServers(); if (webServers != null) { controlWebServers(controlGroupWebServerRequest, aUser, webServers); } } GroupWebServerControlServiceImpl(final GroupService theGroupService, WebServerControlService theWebServerControlService); @Transactional @Override void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser); @Override void controlAllWebSevers(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User user); boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel); }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { @Transactional @Override public void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser) { controlGroupWebServerRequest.validate(); Group group = groupService.getGroupWithWebServers(controlGroupWebServerRequest.getGroupId()); final Set<WebServer> webServers = group.getWebServers(); if (webServers != null) { controlWebServers(controlGroupWebServerRequest, aUser, webServers); } } GroupWebServerControlServiceImpl(final GroupService theGroupService, WebServerControlService theWebServerControlService); @Transactional @Override void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser); @Override void controlAllWebSevers(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User user); boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel);  }