If a task outcome is null, then sequence() throws an NPE. Modified
it to treat a null outcome as a failure.
Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I57b8be27f72c7cbf43e0b3b8816696ab1928f396
return outcome -> {
- if (outcome != null && isSuccess(outcome)) {
+ if (isSuccess(outcome)) {
logger.info("{}: preprocessor succeeded for {}", getFullName(), params.getRequestId());
return CompletableFuture.completedFuture(outcome);
}
* @return {@code true} if the outcome was successful
*/
protected boolean isSuccess(OperationOutcome outcome) {
- return (outcome.getResult() == PolicyResult.SUCCESS);
+ return (outcome != null && outcome.getResult() == PolicyResult.SUCCESS);
}
/**
@Test
public void testIsSuccess() {
+ assertFalse(oper.isSuccess(null));
+
OperationOutcome outcome = new OperationOutcome();
outcome.setResult(PolicyResult.SUCCESS);