@Test
public void listenerRegistration_acceptOnlyWhitelistedHttpMethods(TestContext testContext) {

    // Mock a request using all allowed request methods.
    final int[] statusCodePtr = new int[]{0};
    final String[] statusMessagePtr = new String[]{null};
    final HttpServerRequest request;
    {
        final Buffer requestBody = toBuffer(new JsonObject("{" +
                "    \"methods\": [ \"OPTIONS\" , \"HEAD\" , \"GET\" , \"POST\" , \"PUT\" , \"DELETE\" , \"PATCH\" ]," +
                "    \"destination\": \"/an/example/destination/\"" +
                "}"
        ));
        request = createSimpleRequest(PUT, "/gateleen/example/_hooks/listeners/http/my-service/a-random-hook-8518ul4st8d6944r6k",
                requestBody, statusCodePtr, statusMessagePtr
        );
    }
    // Trigger
    hookHandler.handle(request);
    { // Assert request got accepted.
        testContext.assertEquals(200, statusCodePtr[0]);
    }
}