use of org.guvnor.ala.ui.model.RuntimeKey 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.RuntimeKey in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testStopRuntime.
@Test
public void testStopRuntime() {
ProviderKey providerKey = mock(ProviderKey.class);
RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID);
service.stopRuntime(runtimeKey);
verify(runtimeProvisioningService, times(1)).stopRuntime(RUNTIME_ID);
verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey));
}
use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testStartRuntime.
@Test
public void testStartRuntime() {
ProviderKey providerKey = mock(ProviderKey.class);
RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID);
service.startRuntime(runtimeKey);
verify(runtimeProvisioningService, times(1)).startRuntime(RUNTIME_ID);
verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey));
}
use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method testOnRuntimeDeletedRefreshRequired.
@Test
public void testOnRuntimeDeletedRefreshRequired() {
// load the presenter.
prepareRuntimesInfo();
when(runtimeItems.isEmpty()).thenReturn(true);
presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
RuntimeKey runtimeKey = mock(RuntimeKey.class);
when(runtimeKey.getProviderKey()).thenReturn(providerKey);
when(providerStatusPresenter.removeItem(runtimeKey)).thenReturn(true);
// the provider status presenter is empty after the removal.
when(providerStatusPresenter.isEmpty()).thenReturn(true);
presenter.onRuntimeChange(new RuntimeChangeEvent(RuntimeChange.DELETED, runtimeKey));
verify(providerStatusPresenter, times(1)).removeItem(runtimeKey);
verify(presenter, times(1)).refresh();
}
use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method testOnRuntimeDeleted.
@Test
public void testOnRuntimeDeleted() {
// load the presenter.
prepareRuntimesInfo();
when(runtimeItems.isEmpty()).thenReturn(true);
presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
RuntimeKey runtimeKey = mock(RuntimeKey.class);
when(runtimeKey.getProviderKey()).thenReturn(providerKey);
when(providerStatusPresenter.removeItem(runtimeKey)).thenReturn(true);
// the provider status presenter is not empty after the removal.
when(providerStatusPresenter.isEmpty()).thenReturn(false);
presenter.onRuntimeChange(new RuntimeChangeEvent(RuntimeChange.DELETED, runtimeKey));
verify(providerStatusPresenter, times(1)).removeItem(runtimeKey);
}
Aggregations