@Test(expectedExceptions = RuntimeException.class) public void testIsReadyInvalidReferences() { ReferenceReplacementResult referenceReplacementResult = new ReferenceReplacementResult(); referenceReplacementResult.addInvalidReference("invalid"); doReturn(referenceReplacementResult).when(mockJsonContext).processReferences(any(), anyList()); operationWrapper.isReady(mockExecutorContext, new HashSet<>()); }
public boolean isReady(ExecutorContext executorContext, Set<String> completedOperations) { if(completedOperations.containsAll(dependencies)) { if(updateReadiness(evaluateReferences(executorContext))) { return true; } else { throw new RuntimeException("All dependencies have been completed but there are still pending references."); } } return false; }
OperationWrapper { public boolean isReady(ExecutorContext executorContext, Set<String> completedOperations) { if(completedOperations.containsAll(dependencies)) { if(updateReadiness(evaluateReferences(executorContext))) { return true; } else { throw new RuntimeException("All dependencies have been completed but there are still pending references."); } } return false; } }
OperationWrapper { public boolean isReady(ExecutorContext executorContext, Set<String> completedOperations) { if(completedOperations.containsAll(dependencies)) { if(updateReadiness(evaluateReferences(executorContext))) { return true; } else { throw new RuntimeException("All dependencies have been completed but there are still pending references."); } } return false; } OperationWrapper(Operation operation); }
OperationWrapper { public boolean isReady(ExecutorContext executorContext, Set<String> completedOperations) { if(completedOperations.containsAll(dependencies)) { if(updateReadiness(evaluateReferences(executorContext))) { return true; } else { throw new RuntimeException("All dependencies have been completed but there are still pending references."); } } return false; } OperationWrapper(Operation operation); OperationWrapper init(ExecutorContext executorContext, JsonContextReferenceParser jsonContextReferenceParser); boolean isReady(ExecutorContext executorContext, Set<String> completedOperations); String getInputPayload(); Operation getOperation(); String getOutputPayload(); void setOutputPayload(String outputPayload); Set<String> getDependencies(); Boolean getSuccess(); void setSuccess(Boolean success); List<DiagnosticEvent> getDiagnosticEvents(); void addDiagnosticEvent(DiagnosticEvent diagnosticEvent); BaseOperationExecutor getOperationExecutor(); OperationWrapper setOperationExecutor(BaseOperationExecutor operationExecutor); OperationProgress getPriorExecutionOperationProgress(); void setPriorExecutionOperationProgress(OperationProgress priorExecutionOperationProgress); }
OperationWrapper { public boolean isReady(ExecutorContext executorContext, Set<String> completedOperations) { if(completedOperations.containsAll(dependencies)) { if(updateReadiness(evaluateReferences(executorContext))) { return true; } else { throw new RuntimeException("All dependencies have been completed but there are still pending references."); } } return false; } OperationWrapper(Operation operation); OperationWrapper init(ExecutorContext executorContext, JsonContextReferenceParser jsonContextReferenceParser); boolean isReady(ExecutorContext executorContext, Set<String> completedOperations); String getInputPayload(); Operation getOperation(); String getOutputPayload(); void setOutputPayload(String outputPayload); Set<String> getDependencies(); Boolean getSuccess(); void setSuccess(Boolean success); List<DiagnosticEvent> getDiagnosticEvents(); void addDiagnosticEvent(DiagnosticEvent diagnosticEvent); BaseOperationExecutor getOperationExecutor(); OperationWrapper setOperationExecutor(BaseOperationExecutor operationExecutor); OperationProgress getPriorExecutionOperationProgress(); void setPriorExecutionOperationProgress(OperationProgress priorExecutionOperationProgress);  }