@Test public void getRuntimeItemByRuntimeKeyNotExisting() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); List<RuntimeQueryResultItem> singleResult = new ArrayList<>(); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem result = service.getRuntimeItem(runtimeKey); assertNull(result); }
@Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); }
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } }
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject  RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
                              final PipelineServiceBackend pipelineService,
                              final ProviderService providerService,
                              final Event<RuntimeChangeEvent> runtimeChangeEvent,
                              final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject  RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
                              final PipelineServiceBackend pipelineService,
                              final ProviderService providerService,
                              final Event<RuntimeChangeEvent> runtimeChangeEvent,
                              final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
                                                   final String runtimeName,
                                                   final PipelineKey pipelineKey,
                                                   final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
                              final boolean forced); }
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject  RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
                              final PipelineServiceBackend pipelineService,
                              final ProviderService providerService,
                              final Event<RuntimeChangeEvent> runtimeChangeEvent,
                              final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
                                                   final String runtimeName,
                                                   final PipelineKey pipelineKey,
                                                   final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
                              final boolean forced);  }