EmbeddedSnippet extends AbstractJacksonFieldSnippet { public EmbeddedSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields) { return new EmbeddedSnippet(documentationType, failOnUndocumentedFields); } EmbeddedSnippet();  EmbeddedSnippet(Type documentationType, boolean failOnUndocumentedFields); EmbeddedSnippet documentationType(Type documentationType); EmbeddedSnippet 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 embedded resources were not documented: [embedded1, embedded2]"); new EmbeddedSnippet().documentationType(EmbeddedDocs.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()); }