Search in sources :

Example 1 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class ProviderTypeItemPresenterTest method setUp.

@Before
public void setUp() {
    providerType = new ProviderType(new ProviderTypeKey(PROVIDER_ID, PROVIDER_VERSION), PROVIDER_NAME);
    when(handlerRegistry.getProviderHandler(providerType.getKey())).thenReturn(providerHandler);
    when(providerHandler.getProviderTypeImageURL()).thenReturn(IMAGE_URL);
    presenter = new ProviderTypeItemPresenter(view, handlerRegistry);
    presenter.init();
    verify(view, times(1)).init(presenter);
}
Also used : ProviderType(org.guvnor.ala.ui.model.ProviderType) ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) Before(org.junit.Before)

Example 2 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class ProvisioningManagementBrowserPresenterTest method testOnProviderTypeSelectedWithProviders.

@Test
public void testOnProviderTypeSelectedWithProviders() {
    // pick an arbitrary element as the selected
    ProviderType selectedProviderType = providerTypes.iterator().next();
    ProviderTypeKey selectedProviderTypeKey = selectedProviderType.getKey();
    List<ProviderKey> providerKeys = mockProviderKeyList(selectedProviderType.getKey(), PROVIDER_TYPES_SIZE);
    // pick an arbitrary element as the selected.
    ProviderKey selectedProviderKey = providerKeys.iterator().next();
    ProvidersInfo providersInfo = mock(ProvidersInfo.class);
    when(providersInfo.getProviderType()).thenReturn(selectedProviderType);
    when(providersInfo.getProvidersKey()).thenReturn(providerKeys);
    when(providerTypeService.getProviderType(selectedProviderTypeKey)).thenReturn(selectedProviderType);
    when(provisioningScreensService.getProvidersInfo(selectedProviderTypeKey)).thenReturn(providersInfo);
    presenter.onProviderTypeSelected(new ProviderTypeSelectedEvent(selectedProviderType.getKey(), selectedProviderKey.getId()));
    verify(providerTypePresenter, times(1)).setup(selectedProviderType, providerKeys, selectedProviderKey);
}
Also used : ProviderKey(org.guvnor.ala.ui.model.ProviderKey) ProviderTypeSelectedEvent(org.guvnor.ala.ui.client.events.ProviderTypeSelectedEvent) ProviderType(org.guvnor.ala.ui.model.ProviderType) ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) ProvidersInfo(org.guvnor.ala.ui.model.ProvidersInfo) Test(org.junit.Test)

Example 3 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class ProviderStatusEmptyPresenterTest method setUp.

@Before
public void setUp() {
    ProviderTypeKey providerTypeKey = mockProviderTypeKey("1");
    providerKey = mockProviderKey(providerTypeKey, "1");
    presenter = new ProviderStatusEmptyPresenter(view, refreshRuntimeEvent);
    presenter.init();
    presenter.setup(providerKey);
    verify(view, times(1)).init(presenter);
}
Also used : ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) ProvisioningManagementTestCommons.mockProviderTypeKey(org.guvnor.ala.ui.ProvisioningManagementTestCommons.mockProviderTypeKey) Before(org.junit.Before)

Example 4 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class RuntimePresenterTest method mockRuntime.

protected Runtime mockRuntime() {
    ProviderTypeKey providerTypeKey = mockProviderTypeKey("1");
    ProviderKey providerKey = mockProviderKey(providerTypeKey, "1");
    RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID);
    Runtime runtime = new Runtime(runtimeKey, RUNTIME_NAME, null, RUNTIME_STATUS, ENDPOINT, CREATED_DATE);
    return runtime;
}
Also used : Runtime(org.guvnor.ala.ui.model.Runtime) ProviderKey(org.guvnor.ala.ui.model.ProviderKey) ProvisioningManagementTestCommons.mockProviderKey(org.guvnor.ala.ui.ProvisioningManagementTestCommons.mockProviderKey) RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) ProvisioningManagementTestCommons.mockProviderTypeKey(org.guvnor.ala.ui.ProvisioningManagementTestCommons.mockProviderTypeKey)

Example 5 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class BaseProviderHandlerTest method testAcceptArbitraryProviderType.

@Test
public void testAcceptArbitraryProviderType() {
    ProviderTypeKey providerTypeKey = mock(ProviderTypeKey.class);
    assertFalse(providerHandler.acceptProviderType(providerTypeKey));
}
Also used : ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) Test(org.junit.Test)

Aggregations

ProviderTypeKey (org.guvnor.ala.ui.model.ProviderTypeKey)29 Test (org.junit.Test)18 ProviderKey (org.guvnor.ala.ui.model.ProviderKey)14 Provider (org.guvnor.ala.ui.model.Provider)8 ProviderType (org.guvnor.ala.ui.model.ProviderType)7 Input (org.guvnor.ala.pipeline.Input)4 Before (org.junit.Before)4 ArrayList (java.util.ArrayList)3 ProvisioningManagementTestCommons.mockProviderTypeKey (org.guvnor.ala.ui.ProvisioningManagementTestCommons.mockProviderTypeKey)3 PipelineKey (org.guvnor.ala.ui.model.PipelineKey)3 Map (java.util.Map)2 RuntimeQueryResultItem (org.guvnor.ala.services.api.RuntimeQueryResultItem)2 ProviderTypeSelectedEvent (org.guvnor.ala.ui.client.events.ProviderTypeSelectedEvent)2 AbstractProviderHandlerRegistryTest (org.guvnor.ala.ui.handler.AbstractProviderHandlerRegistryTest)2 ProviderConfiguration (org.guvnor.ala.ui.model.ProviderConfiguration)2 ProvidersInfo (org.guvnor.ala.ui.model.ProvidersInfo)2 Runtime (org.guvnor.ala.ui.model.Runtime)2 RuntimeKey (org.guvnor.ala.ui.model.RuntimeKey)2 RuntimeListItem (org.guvnor.ala.ui.model.RuntimeListItem)2 RuntimeQuery (org.guvnor.ala.services.api.RuntimeQuery)1