private static void evaluateExpectation(EndpointTestExpectation expected, Value actual) {
        if (!(expected.getEndpoint().isPresent() || expected.getError().isPresent())) {
            throw new RuntimeException("Unhandled endpoint test case expectation.");
        }

        if (expected.getEndpoint().isPresent()) {
            ExpectedEndpoint expectedEndpoint = expected.getEndpoint().get();
            EndpointValue.Builder builder = EndpointValue.builder()
                    .url(expectedEndpoint.getUrl())
                    .headers(expectedEndpoint.getHeaders());
            for (Map.Entry<String, Node> entry : expectedEndpoint.getProperties().entrySet()) {
                builder.putProperty(entry.getKey(), Value.fromNode(entry.getValue()));
            }

            if (!actual.expectEndpointValue().equals(builder.build())) {
                throw new AssertionError(String.format("Expected endpoint:%n%s but got:%n%s (generated by %s)",
                        StringUtils.indent(expectedEndpoint.toString(), 2),
                        StringUtils.indent(actual.toString(), 2),
                        expectedEndpoint.getSourceLocation()));
            }
        } else {
            String wantError = expected.getError().get();
            RuleError.context("While checking endpoint test (expecting an error)", () -> {
                if (!actual.expectStringValue().getValue().equals(wantError)) {
                    throw new AssertionError(String.format("Expected error `%s` but got `%s`", wantError, actual));
                }
            });
        }
    }
Evaluate the given rule-set and test case. Throws an exception in the event
the test case does not pass.

@param ruleset  The rule-set to be tested.
@param testCase The test case.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/evaluation/TestEvaluator.java