RequestParametersSnippet extends AbstractParameterSnippet<RequestParam> { public RequestParametersSnippet failOnUndocumentedParams(boolean failOnUndocumentedParams) { return new RequestParametersSnippet(failOnUndocumentedParams); } RequestParametersSnippet();  RequestParametersSnippet(boolean failOnUndocumentedParams); RequestParametersSnippet failOnUndocumentedParams(boolean failOnUndocumentedParams); @Override String getHeaderKey(Operation operation); @Override boolean isMergeable();  }
@Test public void failOnUndocumentedParams() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("searchItem", Integer.class, String.class); initParameters(handlerMethod); thrown.expect(SnippetException.class); thrown.expectMessage("Following query parameters were not documented: [type, text]"); new RequestParametersSnippet().failOnUndocumentedParams(true).document(operationBuilder .attribute(HandlerMethod.class.getName(), handlerMethod) .attribute(JavadocReader.class.getName(), javadocReader) .attribute(ConstraintReader.class.getName(), constraintReader) .build()); }