PhysicalMaterialBuilder { public PhysicalMaterial build() { return m; } PhysicalMaterialBuilder(); PhysicalMaterial build(); PhysicalMaterial build(String xml, CatalogConfiguration catalog); PhysicalMaterialBuilder setCatalog(CatalogConfiguration catalog); PhysicalMaterialBuilder setMetadata(String modsXml); PhysicalMaterialBuilder setRdczId(BigDecimal rdczId);  }
@Test public void testBuild() throws Exception { CatalogConfiguration c = new CatalogConfiguration("testCatalogId", "", new BaseConfiguration() {{ addProperty(CatalogConfiguration.PROPERTY_URL, "tcp: addProperty(CatalogConfiguration.PROPERTY_NAME, "test"); addProperty(CatalogConfiguration.PROPERTY_TYPE, Z3950Catalog.TYPE); }}); String xml = IOUtils.toString(WorkflowManagerTest.class.getResource("rdczmods.xml"), StandardCharsets.UTF_8); PhysicalMaterial pm = new PhysicalMaterialBuilder().build(xml, c); assertEquals(xml, pm.getMetadata()); assertEquals(c.getUrl(), pm.getSource()); assertEquals("Nová vlna = : La nouvelle vague : Truffaut, Godard, Chabrol, Rohmer, Rivette", pm.getLabel()); }