private Consumer<TestOutcome<I, O>> wrapTestOutcomeConsumer(
                final Consumer<TestOutcome<I, O>> testOutcomeConsumer) {

            // Intercept the testOutcome before testOutcomeConsumer sees it, so we can
            // assert for a thrown exception if the test case expected it.
            return testOutcome -> {
                if (testOutcome.isExpectedToThrow()) {
                    final Class<? extends Throwable> expectedThrowableType = testOutcome.getExpectedThrowableType();

                    if (testOutcome.getActualThrowable().isPresent()) {
                        final Throwable actualThrowable = testOutcome.getActualThrowable().get();
                        LOGGER.debug("Test threw exception: '{}' (expecting: {}), message: '{}'",
                                actualThrowable.getClass().getSimpleName(),
                                expectedThrowableType.getSimpleName(),
                                actualThrowable.getMessage());
                        Assertions.assertThat(actualThrowable)
                                .isInstanceOf(expectedThrowableType);
                    } else {
                        LOGGER.debug("Test did not throw an exception but we were expecting it to throw: {}. " +
                                     "Actual output: '{}'",
                                expectedThrowableType.getSimpleName(),
                                testOutcome.getActualOutput());
                        Assertions.fail("Expecting test to throw "
                                        + expectedThrowableType.getSimpleName());
                    }
                } else {
                    LOGGER.debug("Actual output: '{}'", testOutcome.getActualOutput());
                    testOutcomeConsumer.accept(testOutcome);
                }
            };
        }
A pre-canned simple test action that just asserts that the actual output is equal to
the expected output.
If the {@link TestCase} includes an expected {@link Throwable} type then any exceptions will
be intercepted and asserted automatically. The consumer will not be called if an exception is
expected.
stroom-test-common/src/main/java/stroom/test/common/DynamicTestBuilder.java