use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.
the class ProviderServiceImplTest method testGetProviderExisting.
@Test
public void testGetProviderExisting() {
// pick one of the existing providers.
org.guvnor.ala.runtime.providers.Provider providerSpi = providersSpi.get(2);
// create a key for finding it.
ProviderTypeKey providerTypeKey = new ProviderTypeKey(providerSpi.getProviderType().getProviderTypeName(), providerSpi.getProviderType().getVersion());
ProviderKey providerKey = new ProviderKey(providerTypeKey, providerSpi.getId());
Provider provider = service.getProvider(providerKey);
assertNotNull(provider);
assertEquals(providers.get(2).getKey(), provider.getKey());
}
use of org.guvnor.ala.ui.model.ProviderTypeKey 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.ProviderTypeKey in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testGetRuntimeItems.
@Test
public void testGetRuntimeItems() {
ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION);
ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID);
when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(queryItems);
Collection<RuntimeListItem> result = service.getRuntimeItems(providerKey);
Collection<RuntimeListItem> expectedResult = buildExpectedResult(queryItems);
assertEquals(expectedResult, result);
}
use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testGetPipelines.
@Test
public void testGetPipelines() {
ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION);
when(pipelineService.getPipelineNames(any(org.guvnor.ala.runtime.providers.ProviderType.class), anyInt(), anyInt(), anyString(), anyBoolean())).thenReturn(pipelineNames);
Collection<PipelineKey> result = service.getPipelines(providerTypeKey);
assertEquals(pipelineKeys, result);
}
use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testCreateRuntimeWhenUnExpectedError.
@Test
public void testCreateRuntimeWhenUnExpectedError() {
Provider provider = mock(Provider.class);
ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION);
ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID);
when(providerService.getProvider(providerKey)).thenReturn(provider);
when(pipelineService.runPipeline(anyString(), any(Input.class), eq(true))).thenThrow(new RuntimeException(ERROR_MESSAGE));
expectedException.expectMessage(ERROR_MESSAGE);
service.createRuntime(providerKey, "irrelevant for the test", mock(PipelineKey.class), mock(Map.class));
}
Aggregations