ClusterPropertyLoader implements BundleEntityLoader { @Override public void load(Bundle bundle, Element element) { final Element xml = getSingleChildElement(getSingleChildElement(element, RESOURCE), CLUSTER_PROPERTY); final String name = getSingleChildElement(xml, NAME).getTextContent(); final String value = getSingleChildElement(xml, VALUE).getTextContent(); final String id = xml.getAttribute(ATTRIBUTE_ID); ClusterProperty clusterProperty = new ClusterProperty(); clusterProperty.setName(name); clusterProperty.setId(id); clusterProperty.setValue(value); bundle.getClusterProperties().put(name, clusterProperty); }  @Override void load(Bundle bundle, Element element); @Override String getEntityType();  }
@Test void load() { ClusterPropertyLoader loader = new ClusterPropertyLoader(); Bundle bundle = new Bundle(); loader.load(bundle, createXml( DocumentTools.INSTANCE.getDocumentBuilder().newDocument() )); assertFalse(bundle.getClusterProperties().isEmpty()); assertEquals(1, bundle.getClusterProperties().size()); ClusterProperty clusterProperty = bundle.getClusterProperties().get("Prop"); assertNotNull(clusterProperty); assertEquals("Prop", clusterProperty.getName()); assertEquals("Value", clusterProperty.getValue()); assertEquals("id", clusterProperty.getId()); }