@Test
public void invalidRegexGetsRejected( TestContext testContext ) {

    // Wire up victim instance
    final String loggingUrl = "/houston/server/admin/v1/logging";
    final LoggingResourceManager loggingResourceManager = new LoggingResourceManager( vertx , storage , loggingUrl );
    // Mock a request
    final Integer[] responseStatusCode = new Integer[]{ null };
    final DummyHttpServerResponse httpServerResponse = new DummyHttpServerResponse(){
        @Override public synchronized HttpServerResponse setStatusCode( int statusCode ) {
            if( responseStatusCode[0] != null ) logger.debug("Status code "+responseStatusCode[0]+" got overridden with "+statusCode+".");
            // Keep status code to assert it later.
            responseStatusCode[0] = statusCode;
            return this;
        }
    };
    final HttpServerRequest request = new DummyHttpServerRequest(){
        @Override public String uri() {
            return loggingUrl;
        }
        @Override public HttpMethod method() {
            return HttpMethod.PUT;
        }
        @Override public HttpServerRequest bodyHandler(Handler<Buffer> bodyHandler) {
            Buffer buffer = new BufferImpl();
            buffer.setBytes( 0 , ("{\n" +
                    "  \"payload\": {\n" +
                    "    \"filters\": [\n" +
                    "      {\n" +
                    "        \"url\": \"/houston/services/.*(?<!(all/position)$\",\n" +
                    "        \"method\": \"PUT|DELETE\"\n" +
                    "      }\n" +
                    "    ]\n" +
                    "  }\n" +
                    "}\n").getBytes(StandardCharsets.UTF_8));
            bodyHandler.handle( buffer );
            return null;
        }
        @Override public MultiMap headers() {
            return new CaseInsensitiveHeaders();
        }
        @Override public HttpServerResponse response() {
            return httpServerResponse;
        }
    };
    // Trigger victim to do its work.
    final boolean returnValue = loggingResourceManager.handleLoggingResource( request );
    // Assert victim accepted our request.
    testContext.assertTrue( returnValue );
    // did set a response code,
    testContext.assertNotNull( responseStatusCode[0] );
    // responded with a status code of 400,
    testContext.assertEquals( 400 , responseStatusCode[0] );
    // and wrote a ValidationException to the body.
    testContext.assertTrue( httpServerResponse.getResultBuffer().startsWith("ValidationException: ") );
}