use of org.guvnor.ala.ui.model.RuntimesInfo in project kie-wb-common by kiegroup.
the class ProvisioningScreensServiceImpl method getRuntimesInfo.
@Override
public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) {
checkNotNull("providerKey", providerKey);
final Provider provider = providerService.getProvider(providerKey);
if (provider == null) {
return null;
}
final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey);
return new RuntimesInfo(provider, items);
}
use of org.guvnor.ala.ui.model.RuntimesInfo in project kie-wb-common by kiegroup.
the class ProvisioningScreensServiceImplTest method testGetRuntimesInfoProviderNotExisting.
@Test
public void testGetRuntimesInfoProviderNotExisting() {
// the provider not exists.
when(providerService.getProvider(providerKey)).thenReturn(null);
RuntimesInfo info = service.getRuntimesInfo(providerKey);
assertNull(info);
verify(providerService, times(1)).getProvider(providerKey);
verify(runtimeService, never()).getRuntimeItems(providerKey);
}
use of org.guvnor.ala.ui.model.RuntimesInfo in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method prepareRuntimesInfo.
private void prepareRuntimesInfo() {
ProviderTypeKey providerTypeKey = mockProviderTypeKey("1");
providerKey = mockProviderKey(providerTypeKey, "1");
ProviderConfiguration configuration = mock(ProviderConfiguration.class);
provider = new Provider(providerKey, configuration);
runtimesInfo = mock(RuntimesInfo.class);
when(runtimesInfo.getProvider()).thenReturn(provider);
when(runtimesInfo.getRuntimeItems()).thenReturn(runtimeItems);
when(providerService.getProvider(providerKey)).thenReturn(provider);
when(provisioningScreensService.getRuntimesInfo(providerKey)).thenReturn(runtimesInfo);
when(handlerRegistry.isProviderInstalled(providerTypeKey)).thenReturn(true);
when(handlerRegistry.getProviderHandler(providerTypeKey)).thenReturn(handler);
when(handler.getFormResolver()).thenReturn(formResolver);
when(formResolver.newProviderConfigurationForm()).thenReturn(configurationForm);
when(configurationForm.getView()).thenReturn(configurationFormView);
}
use of org.guvnor.ala.ui.model.RuntimesInfo in project kie-wb-common by kiegroup.
the class ProvisioningScreensServiceImplTest method testGetRuntimesInfoProviderExisting.
@Test
public void testGetRuntimesInfoProviderExisting() {
// the provider exists.
when(providerService.getProvider(providerKey)).thenReturn(provider);
when(runtimeService.getRuntimeItems(providerKey)).thenReturn(runtimeListItems);
RuntimesInfo info = service.getRuntimesInfo(providerKey);
assertNotNull(info);
assertEquals(provider, info.getProvider());
assertEquals(runtimeListItems, info.getRuntimeItems());
verify(providerService, times(1)).getProvider(providerKey);
verify(runtimeService, times(1)).getRuntimeItems(providerKey);
}
Aggregations