LinksSnippet extends AbstractJacksonFieldSnippet { public LinksSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields) { return new LinksSnippet(documentationType, failOnUndocumentedFields); } LinksSnippet();  LinksSnippet(Type documentationType, boolean failOnUndocumentedFields); LinksSnippet documentationType(Type documentationType); LinksSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields); @Override String getHeaderKey(Operation operation);  }
@Test public void failOnUndocumentedFields() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("addItem"); thrown.expect(SnippetException.class); thrown.expectMessage("Following hypermedia links were not documented: [link1, link2]"); new LinksSnippet().documentationType(LinksDocs.class).failOnUndocumentedFields(true).document(operationBuilder .attribute(HandlerMethod.class.getName(), handlerMethod) .attribute(ObjectMapper.class.getName(), mapper) .attribute(JavadocReader.class.getName(), javadocReader) .attribute(ConstraintReader.class.getName(), constraintReader) .build()); }