RequestHeaderSnippet extends AbstractParameterSnippet<RequestHeader> { public RequestHeaderSnippet failOnUndocumentedParams(boolean failOnUndocumentedParams) { return new RequestHeaderSnippet(failOnUndocumentedParams); } RequestHeaderSnippet();  RequestHeaderSnippet(boolean failOnUndocumentedParams); RequestHeaderSnippet failOnUndocumentedParams(boolean failOnUndocumentedParams); @Override String getHeaderKey(Operation operation);  }
@Test public void failOnUndocumentedHeaders() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("updateRequiredHeader", Integer.class, String.class, int.class); initParameters(handlerMethod); thrown.expect(SnippetException.class); thrown.expectMessage( "Following request headers were not documented: [id, subId, partId]"); new RequestHeaderSnippet().failOnUndocumentedParams(true).document(operationBuilder .attribute(HandlerMethod.class.getName(), handlerMethod) .attribute(JavadocReader.class.getName(), javadocReader) .attribute(ConstraintReader.class.getName(), constraintReader) .build()); }