@Test
    @Configuration("{\r\n" +
                " \"requestUnmatched\" : \"fail\"," +
                "  \"rules\" : [\r\n" +
                "    { \"action\" : \"reportIncident\", \"role\" : \"user\" },\r\n" +
                "    { \"action\" : \"reportIncident\", \"role\" : \"admin\" }\r\n" +
                "  ]\r\n" +
                "}")
    public void testNoneMatchedFail() throws Throwable {
        HashSet<String> userRoles = new HashSet<>();

        // Should Fail
        PolicyTestRequest request = PolicyTestRequest.build(PolicyTestRequestType.GET, "/other/resource");

        try {
            request.header("SOAPAction", "reportIncident");
            request.contextAttribute(SoapAuthorizationPolicy.AUTHENTICATED_USER_ROLES, userRoles);
            send(request);
            Assert.fail("Expected a failure response!");
        } catch (PolicyFailureError failure) {
            PolicyFailure policyFailure = failure.getFailure();
            Assert.assertNotNull(policyFailure);
            Assert.assertEquals(PolicyFailureType.Authorization, policyFailure.getType());
        }


        // Should Fail
        request = PolicyTestRequest.build(PolicyTestRequestType.POST, "/admin/resource");

        try {
            request.header("SOAPAction", "reportIncident");
            request.contextAttribute(SoapAuthorizationPolicy.AUTHENTICATED_USER_ROLES, userRoles);
            send(request);
            Assert.fail("Expected a failure response!");
        } catch (PolicyFailureError failure) {
            PolicyFailure policyFailure = failure.getFailure();
            Assert.assertNotNull(policyFailure);
        }
    }
Unit test

@author rubenrm1@gmail.com
@author rachel.yordan@redhat.com
@author tevo.souza@hotmail.com
Test the {@link SoapAuthorizationPolicy}.
plugins/soap-authorization-policy/src/test/java/io/apiman/plugins/soap_authorization_policy/SoapAuthorizationPolicyTest.java