Search in sources :

Example 6 with ValidateExistingContainerCallback

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

the class DeploymentPopupBuilderTest method testMultipleServerTemplatesValidationWhenContainerNameDoesNotExist.

@Test
public void testMultipleServerTemplatesValidationWhenContainerNameDoesNotExist() throws Exception {
    final List<ServerTemplate> serverTemplates = new ArrayList<ServerTemplate>() {

        {
            add(serverTemplate("serverTemplate1", "container1", "container2"));
            add(serverTemplate("serverTemplate2", "container1", "container2", "container3"));
            add(serverTemplate("serverTemplate3", "container1", "container2"));
        }
    };
    doNothing().when(popupView).addServerTemplates(any());
    doReturn("serverTemplate1").when(popupView).getServerTemplate();
    final ValidateExistingContainerCallback validation = builder.multipleServerTemplatesValidation(serverTemplates);
    assertFalse(validation.containerNameExists("container3"));
}
Also used : 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)

Aggregations

Test (org.junit.Test)6 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)6 ValidateExistingContainerCallback (org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback)6 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 GWTMockUtilities (com.google.gwt.junit.GWTMockUtilities)2 GwtMockitoTestRunner (com.google.gwtmockito.GwtMockitoTestRunner)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 RunWith (org.junit.runner.RunWith)2 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)2 DeploymentScreenPopupViewImpl (org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentScreenPopupViewImpl)2 Mock (org.mockito.Mock)2 Mockito (org.mockito.Mockito)2 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)2