Search in sources :

Example 1 with DeploymentScreenPopupViewImpl

use of org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl in project kie-wb-common by kiegroup.

the class DeploymentPopupBuilderTest method testBuildDeployWithMultipleServerTemplates.

@Test
public void testBuildDeployWithMultipleServerTemplates() throws Exception {
    final List<ServerTemplate> serverTemplates = new ArrayList<>();
    final ValidateExistingContainerCallback callback = mock(ValidateExistingContainerCallback.class);
    final ParameterizedCommand<DeploymentScreenPopupViewImpl> onSuccess = (v) -> {
    };
    doReturn(callback).when(builder).multipleServerTemplatesValidation(serverTemplates);
    builder.buildDeployWithMultipleServerTemplates(serverTemplates, onSuccess);
    verify(builder).setViewFields(onSuccess, callback);
}
Also used : DeploymentScreenPopupViewImpl(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl) GwtMockitoTestRunner(com.google.gwtmockito.GwtMockitoTestRunner) ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand) BeforeClass(org.junit.BeforeClass) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) Mock(org.mockito.Mock) ValidateExistingContainerCallback(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback) RunWith(org.junit.runner.RunWith) Set(java.util.Set) Test(org.junit.Test) ContainerSpec(org.kie.server.controller.api.model.spec.ContainerSpec) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Mockito(org.mockito.Mockito) List(java.util.List) GWTMockUtilities(com.google.gwt.junit.GWTMockUtilities) DeploymentScreenPopupViewImpl(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl) Assert(org.junit.Assert) Before(org.junit.Before) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) ArrayList(java.util.ArrayList) ValidateExistingContainerCallback(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback) Test(org.junit.Test)

Example 2 with DeploymentScreenPopupViewImpl

use of org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl in project kie-wb-common by kiegroup.

the class DeploymentPopupBuilderTest method testBuildDeployWithOneServerTemplate.

@Test
public void testBuildDeployWithOneServerTemplate() throws Exception {
    final ServerTemplate serverTemplate = mock(ServerTemplate.class);
    final ValidateExistingContainerCallback callback = mock(ValidateExistingContainerCallback.class);
    final ParameterizedCommand<DeploymentScreenPopupViewImpl> onSuccess = (v) -> {
    };
    doReturn(callback).when(builder).singleServerTemplatesValidation(serverTemplate);
    builder.buildDeployWithOneServerTemplate(serverTemplate, onSuccess);
    verify(builder).setViewFields(onSuccess, callback);
}
Also used : DeploymentScreenPopupViewImpl(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl) GwtMockitoTestRunner(com.google.gwtmockito.GwtMockitoTestRunner) ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand) BeforeClass(org.junit.BeforeClass) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) Mock(org.mockito.Mock) ValidateExistingContainerCallback(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback) RunWith(org.junit.runner.RunWith) Set(java.util.Set) Test(org.junit.Test) ContainerSpec(org.kie.server.controller.api.model.spec.ContainerSpec) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Mockito(org.mockito.Mockito) List(java.util.List) GWTMockUtilities(com.google.gwt.junit.GWTMockUtilities) DeploymentScreenPopupViewImpl(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl) Assert(org.junit.Assert) Before(org.junit.Before) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) ValidateExistingContainerCallback(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback) Test(org.junit.Test)

Aggregations

GWTMockUtilities (com.google.gwt.junit.GWTMockUtilities)2 GwtMockitoTestRunner (com.google.gwtmockito.GwtMockitoTestRunner)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Set (java.util.Set)2 Assert (org.junit.Assert)2 Before (org.junit.Before)2 BeforeClass (org.junit.BeforeClass)2 Test (org.junit.Test)2 RunWith (org.junit.runner.RunWith)2 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)2 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)2 DeploymentScreenPopupViewImpl (org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl)2 ValidateExistingContainerCallback (org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback)2 Mock (org.mockito.Mock)2 Mockito (org.mockito.Mockito)2 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)2