ConfigurableSmithyBuildPlugin implements SmithyBuildPlugin { @Override public void execute(PluginContext context) { NodeMapper mapper = new NodeMapper(); T config = mapper.deserialize(context.getSettings(), getConfigType()); executeWithConfig(context, config); }  abstract Class<T> getConfigType(); @Override void execute(PluginContext context);  }
@Test public void loadsConfigurationClass() { Model model = Model.assembler() .addImport(getClass().getResource("sources/a.smithy")) .assemble() .unwrap(); MockManifest manifest = new MockManifest(); PluginContext context = PluginContext.builder() .settings(Node.objectNode() .withMember("foo", "hello") .withMember("bar", 10) .withMember("baz", true)) .fileManifest(manifest) .model(model) .originalModel(model) .build(); new Configurable().execute(context); String manifestString = manifest.getFileString("Config").get(); assertThat(manifestString, containsString("hello")); assertThat(manifestString, containsString("10")); assertThat(manifestString, containsString("true")); }