@Test public void testStartContainer() { final List<?> expectedContainers = mock(List.class); doReturn(operation).when(instanceManager).makeStartContainerOperation(containerSpec); doReturn(expectedContainers).when(instanceManager).callRemoteKieServerOperation(serverTemplate, containerSpec, operation); final List<Container> actualContainers = instanceManager.startContainer(serverTemplate, containerSpec); verify(instanceManager).callRemoteKieServerOperation(serverTemplate, containerSpec, operation); assertEquals(expectedContainers, actualContainers); }
public synchronized List<Container> startContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { final RemoteKieServerOperation<Void> startContainerOperation = makeStartContainerOperation(containerSpec); return callRemoteKieServerOperation(serverTemplate, containerSpec, startContainerOperation); }
KieServerInstanceManager { public synchronized List<Container> startContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { final RemoteKieServerOperation<Void> startContainerOperation = makeStartContainerOperation(containerSpec); return callRemoteKieServerOperation(serverTemplate, containerSpec, startContainerOperation); } }
KieServerInstanceManager { public synchronized List<Container> startContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { final RemoteKieServerOperation<Void> startContainerOperation = makeStartContainerOperation(containerSpec); return callRemoteKieServerOperation(serverTemplate, containerSpec, startContainerOperation); } KieServerInstanceManager(); }
KieServerInstanceManager { public synchronized List<Container> startContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { final RemoteKieServerOperation<Void> startContainerOperation = makeStartContainerOperation(containerSpec); return callRemoteKieServerOperation(serverTemplate, containerSpec, startContainerOperation); } KieServerInstanceManager(); static KieServerInstanceManager getInstance(); List<Container> startScanner(ServerTemplate serverTemplate,
                                        final ContainerSpec containerSpec,
                                        final long interval); List<Container> stopScanner(ServerTemplate serverTemplate,
                                       final ContainerSpec containerSpec); List<Container> scanNow(ServerTemplate serverTemplate,
                                   final ContainerSpec containerSpec); synchronized List<Container> startContainer(final ServerTemplate serverTemplate,
                                                       final ContainerSpec containerSpec); synchronized List<Container> stopContainer(ServerTemplate serverTemplate,
                                                      final ContainerSpec containerSpec); List<Container> upgradeContainer(final ServerTemplate serverTemplate,
                                            final ContainerSpec containerSpec); List<Container> upgradeContainer(final ServerTemplate serverTemplate,
                                            final ContainerSpec containerSpec,
                                            final boolean resetBeforeUpdate); List<Container> upgradeAndStartContainer(final ServerTemplate serverTemplate,
                                                    final ContainerSpec containerSpec); List<Container> upgradeAndStartContainer(final ServerTemplate serverTemplate,
                                                    final ContainerSpec containerSpec,
                                                    final boolean resetBeforeUpdate); List<Container> getContainers(final ServerTemplate serverTemplate,
                                         final ContainerSpec containerSpec); List<Container> getContainers(ServerInstanceKey serverInstanceKey); synchronized List<Container> activateContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec); synchronized List<Container> deactivateContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec); boolean isAlive(ServerInstanceKey serverInstanceKey); }
KieServerInstanceManager { public synchronized List<Container> startContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { final RemoteKieServerOperation<Void> startContainerOperation = makeStartContainerOperation(containerSpec); return callRemoteKieServerOperation(serverTemplate, containerSpec, startContainerOperation); } KieServerInstanceManager(); static KieServerInstanceManager getInstance(); List<Container> startScanner(ServerTemplate serverTemplate,
                                        final ContainerSpec containerSpec,
                                        final long interval); List<Container> stopScanner(ServerTemplate serverTemplate,
                                       final ContainerSpec containerSpec); List<Container> scanNow(ServerTemplate serverTemplate,
                                   final ContainerSpec containerSpec); synchronized List<Container> startContainer(final ServerTemplate serverTemplate,
                                                       final ContainerSpec containerSpec); synchronized List<Container> stopContainer(ServerTemplate serverTemplate,
                                                      final ContainerSpec containerSpec); List<Container> upgradeContainer(final ServerTemplate serverTemplate,
                                            final ContainerSpec containerSpec); List<Container> upgradeContainer(final ServerTemplate serverTemplate,
                                            final ContainerSpec containerSpec,
                                            final boolean resetBeforeUpdate); List<Container> upgradeAndStartContainer(final ServerTemplate serverTemplate,
                                                    final ContainerSpec containerSpec); List<Container> upgradeAndStartContainer(final ServerTemplate serverTemplate,
                                                    final ContainerSpec containerSpec,
                                                    final boolean resetBeforeUpdate); List<Container> getContainers(final ServerTemplate serverTemplate,
                                         final ContainerSpec containerSpec); List<Container> getContainers(ServerInstanceKey serverInstanceKey); synchronized List<Container> activateContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec); synchronized List<Container> deactivateContainer(final ServerTemplate serverTemplate, final ContainerSpec containerSpec); boolean isAlive(ServerInstanceKey serverInstanceKey);  }