@Test public void updatesMetadataReferences() { Model model = Model.assembler() .addImport(IntegTest.class.getResource("rename-shape-test-model.json")) .assemble() .unwrap(); Map<ShapeId, ShapeId> renamed = new HashMap<>(); ShapeId fooUnreferenced = ShapeId.from("ns.foo#UnreferencedString"); ShapeId barUnreferenced = ShapeId.from("ns.bar#UnreferencedString"); renamed.put(fooUnreferenced, barUnreferenced); ModelTransformer transformer = ModelTransformer.create(); Model result = transformer.renameShapes(model, renamed); assertTrue(result.getShape(barUnreferenced).isPresent()); assertFalse(result.getShape(fooUnreferenced).isPresent()); }
RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier) { this.renamed = new HashMap<>(renamed); this.assembler = modelAssemblerSupplier.get(); }
RenameShapes { RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier) { this.renamed = new HashMap<>(renamed); this.assembler = modelAssemblerSupplier.get(); } }
RenameShapes { RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier) { this.renamed = new HashMap<>(renamed); this.assembler = modelAssemblerSupplier.get(); } RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier); }
RenameShapes { RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier) { this.renamed = new HashMap<>(renamed); this.assembler = modelAssemblerSupplier.get(); } RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier);  }
RenameShapes { RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier) { this.renamed = new HashMap<>(renamed); this.assembler = modelAssemblerSupplier.get(); } RenameShapes(Map<ShapeId, ShapeId> renamed, Supplier<ModelAssembler> modelAssemblerSupplier);   }