@Test public void removesTraitsFromAuthDefinitionWhenReferenceRemoved() { Model model = Model.assembler() .addImport(getClass().getResource("remove-shapes.json")) .assemble() .unwrap(); ShapeId removedId = ShapeId.from("ns.foo#bar"); Shape removedShape = model.expectShape(removedId); ModelTransformer transformer = ModelTransformer.create(); Model result = transformer.removeShapes(model, Collections.singletonList(removedShape)); ShapeId subjectId = ShapeId.from("ns.foo#auth"); Shape subject = result.expectShape(subjectId); AuthDefinitionTrait trait = subject.getTrait(AuthDefinitionTrait.class).get(); assertFalse(trait.getTraits().contains(removedId)); }
RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins) { this.toRemove = toRemove; this.plugins = plugins; }
RemoveShapes { RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins) { this.toRemove = toRemove; this.plugins = plugins; } }
RemoveShapes { RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins) { this.toRemove = toRemove; this.plugins = plugins; } RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins); }
RemoveShapes { RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins) { this.toRemove = toRemove; this.plugins = plugins; } RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins);  }
RemoveShapes { RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins) { this.toRemove = toRemove; this.plugins = plugins; } RemoveShapes(Collection<Shape> toRemove, List<ModelTransformerPlugin> plugins);   }