ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> { private List<BindingPattern> serverBindings(Element searchElement, BindingPattern... defaultBindings) { List<Element> bindings = XML.getChildren(searchElement, "binding"); if (bindings.isEmpty()) return List.of(defaultBindings); return toBindingList(bindings); } ContainerModelBuilder(boolean standaloneBuilder, Networking networking); @Override List<ConfigModelId> handlesElements(); @Override void doBuild(ContainerModel model, Element spec, ConfigModelContext modelContext); static boolean isContainerTag(Element element); static final List<ConfigModelId> configModelIds; }
@Test public void verify_bindings_for_builtin_handlers() { Element clusterElem = DomBuilderTest.parse( "<container id='default' version='1.0' />" ); createModel(root, clusterElem); JdiscBindingsConfig config = root.getConfig(JdiscBindingsConfig.class, "default/container.0"); JdiscBindingsConfig.Handlers defaultRootHandler = config.handlers(BindingsOverviewHandler.class.getName()); assertThat(defaultRootHandler.serverBindings(), contains("http:/ApplicationStatus")); JdiscBindingsConfig.Handlers fileRequestHandler = config.handlers(VipStatusHandler.class.getName()); assertThat(fileRequestHandler.serverBindings(), contains("http:/metrics/v2", "http: }