use of org.guvnor.ala.ui.model.ProviderConfiguration 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.ProviderConfiguration in project kie-wb-common by kiegroup.
the class ProviderConverterImpl method toModel.
/**
* @param provider A provider representation in the guvnor-ala core domain.
* @return the converted version of the provider in the format managed by the UI related modules.
*/
@Override
public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) {
Provider result = null;
if (provider != null) {
ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion());
ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId());
final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey);
@SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig());
result = new Provider(providerKey, providerConfiguration);
}
return result;
}
Aggregations