@Test public void testUpdateContainerProcessConfig() { final SpecManagementServiceImpl specManagementService = (SpecManagementServiceImpl) this.specManagementService; final ProcessConfig processConfig = mock(ProcessConfig.class); final Capability capability = Capability.PROCESS; final ServerTemplate serverTemplate = mock(ServerTemplate.class); final ContainerSpec containerSpec = mock(ContainerSpec.class); final Map<Capability, ProcessConfig> configs = spy(new HashMap<>()); final List<?> expectedContainers = mock(List.class); doReturn(configs).when(containerSpec).getConfigs(); doReturn(expectedContainers).when(kieServerInstanceManager).upgradeContainer(serverTemplate, containerSpec); final List<Container> actualContainers = specManagementService.updateContainerProcessConfig(processConfig, capability, serverTemplate, containerSpec); assertEquals(expectedContainers, actualContainers); }
List<Container> updateContainerProcessConfig(final ProcessConfig processConfig, final Capability capability, final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { containerSpec.getConfigs().put(capability, processConfig); return kieServerInstanceManager.upgradeContainer(serverTemplate, containerSpec); }
SpecManagementServiceImpl implements SpecManagementService { List<Container> updateContainerProcessConfig(final ProcessConfig processConfig, final Capability capability, final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { containerSpec.getConfigs().put(capability, processConfig); return kieServerInstanceManager.upgradeContainer(serverTemplate, containerSpec); } }
SpecManagementServiceImpl implements SpecManagementService { List<Container> updateContainerProcessConfig(final ProcessConfig processConfig, final Capability capability, final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { containerSpec.getConfigs().put(capability, processConfig); return kieServerInstanceManager.upgradeContainer(serverTemplate, containerSpec); }  }
SpecManagementServiceImpl implements SpecManagementService { List<Container> updateContainerProcessConfig(final ProcessConfig processConfig, final Capability capability, final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { containerSpec.getConfigs().put(capability, processConfig); return kieServerInstanceManager.upgradeContainer(serverTemplate, containerSpec); }  @Override synchronized void saveContainerSpec(String serverTemplateId,
                                               ContainerSpec containerSpec); @Override synchronized void updateContainerSpec(String serverTemplateId, ContainerSpec containerSpec); @Override synchronized void updateContainerSpec(final String serverTemplateId, final String containerId, final ContainerSpec containerSpec); @Override synchronized void updateContainerSpec(String serverTemplateId, String containerId, ContainerSpec containerSpec, Boolean resetBeforeUpdate); @Override synchronized void saveServerTemplate(ServerTemplate serverTemplate); @Override ServerTemplate getServerTemplate(String serverTemplateId); @Override ServerTemplateKeyList listServerTemplateKeys(); @Override ServerTemplateList listServerTemplates(); @Override ContainerSpecList listContainerSpec(String serverTemplateId); @Override ContainerSpec getContainerInfo(String serverTemplateId,
                                          String containerId); @Override synchronized void deleteContainerSpec(String serverTemplateId,
                                                 String containerSpecId); @Override synchronized void deleteServerTemplate(String serverTemplateId); @Override synchronized void copyServerTemplate(String serverTemplateId,
                                                String newServerTemplateId,
                                                String newServerTemplateName); @Override synchronized void updateContainerConfig(final String serverTemplateId,
                                                   final String containerSpecId,
                                                   final Capability capability,
                                                   final ContainerConfig containerConfig); @Override synchronized void updateServerTemplateConfig(String serverTemplateId,
                                                        Capability capability,
                                                        ServerConfig serverTemplateConfig); @Override synchronized void startContainer(ContainerSpecKey containerSpecKey); @Override synchronized void stopContainer(ContainerSpecKey containerSpecKey); @Override synchronized void activateContainer(ContainerSpecKey containerSpecKey); @Override synchronized void deactivateContainer(ContainerSpecKey containerSpecKey); @Override void deleteServerInstance(final ServerInstanceKey serverInstanceKey); KieServerTemplateStorage getTemplateStorage(); void setTemplateStorage(KieServerTemplateStorage templateStorage); NotificationService getNotificationService(); void setNotificationService(NotificationService notificationService); KieServerInstanceManager getKieServerInstanceManager(); void setKieServerInstanceManager(KieServerInstanceManager kieServerInstanceManager); }
SpecManagementServiceImpl implements SpecManagementService { List<Container> updateContainerProcessConfig(final ProcessConfig processConfig, final Capability capability, final ServerTemplate serverTemplate, final ContainerSpec containerSpec) { containerSpec.getConfigs().put(capability, processConfig); return kieServerInstanceManager.upgradeContainer(serverTemplate, containerSpec); }  @Override synchronized void saveContainerSpec(String serverTemplateId,
                                               ContainerSpec containerSpec); @Override synchronized void updateContainerSpec(String serverTemplateId, ContainerSpec containerSpec); @Override synchronized void updateContainerSpec(final String serverTemplateId, final String containerId, final ContainerSpec containerSpec); @Override synchronized void updateContainerSpec(String serverTemplateId, String containerId, ContainerSpec containerSpec, Boolean resetBeforeUpdate); @Override synchronized void saveServerTemplate(ServerTemplate serverTemplate); @Override ServerTemplate getServerTemplate(String serverTemplateId); @Override ServerTemplateKeyList listServerTemplateKeys(); @Override ServerTemplateList listServerTemplates(); @Override ContainerSpecList listContainerSpec(String serverTemplateId); @Override ContainerSpec getContainerInfo(String serverTemplateId,
                                          String containerId); @Override synchronized void deleteContainerSpec(String serverTemplateId,
                                                 String containerSpecId); @Override synchronized void deleteServerTemplate(String serverTemplateId); @Override synchronized void copyServerTemplate(String serverTemplateId,
                                                String newServerTemplateId,
                                                String newServerTemplateName); @Override synchronized void updateContainerConfig(final String serverTemplateId,
                                                   final String containerSpecId,
                                                   final Capability capability,
                                                   final ContainerConfig containerConfig); @Override synchronized void updateServerTemplateConfig(String serverTemplateId,
                                                        Capability capability,
                                                        ServerConfig serverTemplateConfig); @Override synchronized void startContainer(ContainerSpecKey containerSpecKey); @Override synchronized void stopContainer(ContainerSpecKey containerSpecKey); @Override synchronized void activateContainer(ContainerSpecKey containerSpecKey); @Override synchronized void deactivateContainer(ContainerSpecKey containerSpecKey); @Override void deleteServerInstance(final ServerInstanceKey serverInstanceKey); KieServerTemplateStorage getTemplateStorage(); void setTemplateStorage(KieServerTemplateStorage templateStorage); NotificationService getNotificationService(); void setNotificationService(NotificationService notificationService); KieServerInstanceManager getKieServerInstanceManager(); void setKieServerInstanceManager(KieServerInstanceManager kieServerInstanceManager);  }