Search in sources :

Example 6 with ProviderSelectedEvent

use of org.guvnor.ala.ui.client.events.ProviderSelectedEvent in project kie-wb-common by kiegroup.

the class ProviderPresenterTest method testDeploy.

@Test
public void testDeploy() {
    // emulate that the provider was previously loaded.
    prepareRuntimesInfo();
    presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
    // emulate the user adding a new deploy.
    presenter.deploy();
    verify(addNewRuntimeEvent, times(1)).fire(new AddNewRuntimeEvent(provider));
}
Also used : ProviderSelectedEvent(org.guvnor.ala.ui.client.events.ProviderSelectedEvent) AddNewRuntimeEvent(org.guvnor.ala.ui.client.events.AddNewRuntimeEvent) Test(org.junit.Test)

Example 7 with ProviderSelectedEvent

use of org.guvnor.ala.ui.client.events.ProviderSelectedEvent in project kie-wb-common by kiegroup.

the class ProvisioningManagementBrowserPresenterTest method testOnProviderSelected.

@Test
public void testOnProviderSelected() {
    presenter.onProviderSelected(new ProviderSelectedEvent(mock(ProviderKey.class)));
    verify(view, times(1)).setContent(providerPresenterView);
}
Also used : ProviderSelectedEvent(org.guvnor.ala.ui.client.events.ProviderSelectedEvent) Test(org.junit.Test)

Example 8 with ProviderSelectedEvent

use of org.guvnor.ala.ui.client.events.ProviderSelectedEvent in project kie-wb-common by kiegroup.

the class ProviderTypePresenterTest method testSetup.

@Test
public void testSetup() {
    presenter.setup(providerType, providers, provider);
    verify(view, times(1)).clear();
    verify(view, times(1)).setProviderTypeName(getDisplayableProviderTypeName(providerType));
    providers.forEach(providerKey -> verify(view, times(1)).addProvider(eq(provider.getId()), eq(provider.getId()), any(Command.class)));
    verify(providerSelectedEvent, times(1)).fire(new ProviderSelectedEvent(provider));
}
Also used : ProviderSelectedEvent(org.guvnor.ala.ui.client.events.ProviderSelectedEvent) Test(org.junit.Test)

Example 9 with ProviderSelectedEvent

use of org.guvnor.ala.ui.client.events.ProviderSelectedEvent in project kie-wb-common by kiegroup.

the class ProviderPresenterTest method testOnProviderSelectedWithRuntimes.

@Test
public void testOnProviderSelectedWithRuntimes() {
    prepareRuntimesInfo();
    // emulate that there are runtimes.
    when(runtimeItems.isEmpty()).thenReturn(false);
    presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
    // the ui must have been loaded with the items.
    verifyUILoadedWithItems(1);
    // common verifications.
    verifyRuntimesInfoLoaded(1);
}
Also used : ProviderSelectedEvent(org.guvnor.ala.ui.client.events.ProviderSelectedEvent) Test(org.junit.Test)

Example 10 with ProviderSelectedEvent

use of org.guvnor.ala.ui.client.events.ProviderSelectedEvent in project kie-wb-common by kiegroup.

the class ProviderPresenterTest method testOnProviderSelectedWithNoRuntimes.

@Test
public void testOnProviderSelectedWithNoRuntimes() {
    prepareRuntimesInfo();
    // emulate that there are no runtimes.
    when(runtimeItems.isEmpty()).thenReturn(true);
    presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
    verifyUILoadedWithNoItems(1);
    // common verifications.
    verifyRuntimesInfoLoaded(1);
}
Also used : ProviderSelectedEvent(org.guvnor.ala.ui.client.events.ProviderSelectedEvent) Test(org.junit.Test)

Aggregations

ProviderSelectedEvent (org.guvnor.ala.ui.client.events.ProviderSelectedEvent)15 Test (org.junit.Test)12 PipelineExecutionChangeEvent (org.guvnor.ala.ui.events.PipelineExecutionChangeEvent)2 RuntimeChangeEvent (org.guvnor.ala.ui.events.RuntimeChangeEvent)2 PipelineExecutionTraceKey (org.guvnor.ala.ui.model.PipelineExecutionTraceKey)2 RuntimeKey (org.guvnor.ala.ui.model.RuntimeKey)2 AddNewRuntimeEvent (org.guvnor.ala.ui.client.events.AddNewRuntimeEvent)1 ProviderTypeSelectedEvent (org.guvnor.ala.ui.client.events.ProviderTypeSelectedEvent)1 Command (org.uberfire.mvp.Command)1 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)1