use of org.kie.workbench.common.screens.server.management.service.SpecManagementService in project kie-wb-common by kiegroup.
the class NewContainerFormPresenterTest method init.
@Before
public void init() {
contentChangeHandlers.clear();
m2RepoServiceCaller = new CallerMock<M2RepoService>(m2RepoService);
specManagementServiceCaller = new CallerMock<SpecManagementService>(specManagementService);
doNothing().when(wizardPageStatusChangeEvent).fire(any(WizardPageStatusChangeEvent.class));
doAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
final ContentChangeHandler handler = (ContentChangeHandler) invocation.getArguments()[0];
contentChangeHandlers.add(handler);
return null;
}
}).when(view).addContentChangeHandler(any(ContentChangeHandler.class));
doAnswer(contentHandlerAnswer).when(view).setArtifactId(anyString());
doAnswer(contentHandlerAnswer).when(view).setGroupId(anyString());
doAnswer(contentHandlerAnswer).when(view).setVersion(anyString());
presenter = spy(new NewContainerFormPresenter(logger, view, presenterProvider, m2RepoServiceCaller, specManagementServiceCaller, wizardPageStatusChangeEvent));
doReturn(artifactListWidgetPresenter).when(presenterProvider).get();
}
use of org.kie.workbench.common.screens.server.management.service.SpecManagementService in project kie-wb-common by kiegroup.
the class ContainerPresenterTest method init.
@Before
public void init() {
runtimeManagementServiceCaller = new CallerMock<RuntimeManagementService>(runtimeManagementService);
specManagementServiceCaller = new CallerMock<SpecManagementService>(specManagementService);
doNothing().when(serverTemplateSelectedEvent).fire(any(ServerTemplateSelected.class));
doNothing().when(notification).fire(any(NotificationEvent.class));
when(containerStatusEmptyPresenter.getView()).thenReturn(containerStatusEmptyPresenterView);
when(containerRemoteStatusPresenter.getView()).thenReturn(containerRemoteStatusPresenterView);
presenter = spy(new ContainerPresenter(logger, view, containerRemoteStatusPresenter, containerStatusEmptyPresenter, containerProcessConfigPresenter, containerRulesConfigPresenter, runtimeManagementServiceCaller, specManagementServiceCaller, serverTemplateSelectedEvent, notification));
releaseId = new ReleaseId("org.kie", "container", "1.0.0");
serverTemplateKey = new ServerTemplateKey("serverTemplateKeyId", "serverTemplateKeyName");
containerSpec = new ContainerSpec("containerId", "containerName", serverTemplateKey, releaseId, KieContainerStatus.STOPPED, new HashMap<Capability, ContainerConfig>());
containerSpec.addConfig(Capability.PROCESS, new ProcessConfig());
containerSpec.addConfig(Capability.RULE, new RuleConfig());
containers = new ArrayList<Container>();
containerSpecData = new ContainerSpecData(containerSpec, containers);
}
use of org.kie.workbench.common.screens.server.management.service.SpecManagementService in project kie-wb-common by kiegroup.
the class NewContainerWizardTest method setup.
@Before
public void setup() throws IllegalAccessException, NoSuchFieldException {
doNothing().when(notification).fire(any(NotificationEvent.class));
doNothing().when(serverTemplateSelectedEvent).fire(any(ServerTemplateSelected.class));
specManagementServiceCaller = new CallerMock<SpecManagementService>(specManagementService);
when(newContainerFormPresenter.getView()).thenReturn(newContainerFormPresenterView);
newContainerWizard = spy(new NewContainerWizard(newContainerFormPresenter, processConfigPagePresenter, specManagementServiceCaller, notification, serverTemplateSelectedEvent));
final Field field = AbstractWizard.class.getDeclaredField("view");
field.setAccessible(true);
field.set(newContainerWizard, view);
}
use of org.kie.workbench.common.screens.server.management.service.SpecManagementService in project kie-wb-common by kiegroup.
the class NewServerTemplateWizardTest method setup.
@Before
public void setup() throws IllegalAccessException, NoSuchFieldException {
specManagementServiceCaller = new CallerMock<SpecManagementService>(specManagementService);
when(newTemplatePresenter.getView()).thenReturn(newTemplatePresenterView);
final Answer addContentChangeHandler = new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
final ContentChangeHandler handler = (ContentChangeHandler) invocation.getArguments()[0];
contentChangeHandlers.add(handler);
return null;
}
};
doAnswer(addContentChangeHandler).when(newTemplatePresenter).addContentChangeHandler(any(ContentChangeHandler.class));
doAnswer(addContentChangeHandler).when(newContainerFormPresenter).addContentChangeHandler(any(ContentChangeHandler.class));
newServerTemplateWizard = new NewServerTemplateWizard(newTemplatePresenter, newContainerFormPresenter, processConfigPagePresenter, specManagementServiceCaller, notification, serverTemplateListRefreshEvent);
final Field field = AbstractWizard.class.getDeclaredField("view");
field.setAccessible(true);
field.set(newServerTemplateWizard, view);
newServerTemplateWizard = spy(newServerTemplateWizard);
}
Aggregations