Search in sources :

Example 1 with AddNewRuntimeEvent

use of org.guvnor.ala.ui.client.events.AddNewRuntimeEvent 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 2 with AddNewRuntimeEvent

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

the class ProvisioningManagementPerspectiveTest method testAddNewRuntime.

@Test
public void testAddNewRuntime() {
    Provider provider = new Provider(mockProviderKey(mockProviderTypeKey(""), ""), mock(ProviderConfiguration.class));
    @SuppressWarnings("unchecked") List<PipelineKey> pipelines = mock(List.class);
    when(runtimeService.getPipelines(provider.getKey().getProviderTypeKey())).thenReturn(pipelines);
    perspective.onAddNewRuntime(new AddNewRuntimeEvent(provider));
    verify(newDeployWizard, times(1)).start(provider, pipelines);
}
Also used : PipelineKey(org.guvnor.ala.ui.model.PipelineKey) AddNewRuntimeEvent(org.guvnor.ala.ui.client.events.AddNewRuntimeEvent) Provider(org.guvnor.ala.ui.model.Provider) ProviderConfiguration(org.guvnor.ala.ui.model.ProviderConfiguration) Test(org.junit.Test)

Aggregations

AddNewRuntimeEvent (org.guvnor.ala.ui.client.events.AddNewRuntimeEvent)2 Test (org.junit.Test)2 ProviderSelectedEvent (org.guvnor.ala.ui.client.events.ProviderSelectedEvent)1 PipelineKey (org.guvnor.ala.ui.model.PipelineKey)1 Provider (org.guvnor.ala.ui.model.Provider)1 ProviderConfiguration (org.guvnor.ala.ui.model.ProviderConfiguration)1