use of org.guvnor.ala.ui.model.ProviderType in project kie-wb-common by kiegroup.
the class ProviderTypeServiceImplTest method testGetProviderTypeExisting.
@Test
public void testGetProviderTypeExisting() {
// pick an arbitrary existing provider type
org.guvnor.ala.runtime.providers.ProviderType providerTypeSpi = providerTypesSpi.get(2);
ProviderTypeKey providerTypeKey = new ProviderTypeKey(providerTypeSpi.getProviderTypeName(), providerTypeSpi.getVersion());
ProviderType providerType = service.getProviderType(providerTypeKey);
assertNotNull(providerType);
assertEquals(providerTypeSpi.getProviderTypeName(), providerType.getKey().getId());
assertEquals(providerTypeSpi.getVersion(), providerType.getKey().getVersion());
}
use of org.guvnor.ala.ui.model.ProviderType in project kie-wb-common by kiegroup.
the class ProvisioningManagementBrowserPresenterTest method testOnRefreshProviderTypesWithEnabledProviderTypes.
@Test
public void testOnRefreshProviderTypesWithEnabledProviderTypes() {
when(providerTypeService.getEnabledProviderTypes()).thenReturn(providerTypes);
// pick an arbitrary element as the selected
ProviderType selectedProviderType = providerTypes.iterator().next();
presenter.onRefreshProviderTypes(new ProviderTypeListRefreshEvent(selectedProviderType.getKey()));
// the provider type navigation presenter must have been set properly.
verify(providerTypeNavigationPresenter, times(1)).setup(selectedProviderType, providerTypes);
verify(providerTypeSelectedEvent, times(1)).fire(new ProviderTypeSelectedEvent(selectedProviderType.getKey()));
}
use of org.guvnor.ala.ui.model.ProviderType 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);
}
use of org.guvnor.ala.ui.model.ProviderType 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);
}
use of org.guvnor.ala.ui.model.ProviderType in project kie-wb-common by kiegroup.
the class ProvisioningManagementPerspectiveTest method testAddNewProvider.
@Test
public void testAddNewProvider() {
ProviderType providerType = mockProviderType("");
perspective.onAddNewProvider(new AddNewProviderEvent(providerType));
verify(newProviderWizard, times(1)).start(providerType);
}
Aggregations