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);
}
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);
}
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);
}
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;
}
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));
}
Aggregations