@Test public void updatesListMemberWhenContainerUpdated() { ShapeId stringId = ShapeId.from("ns.foo#String"); ShapeId containerId = ShapeId.from("ns.foo#Container"); ShapeId memberId = ShapeId.from("ns.foo#Container$member"); StringShape target = StringShape.builder().id(stringId).build(); MemberShape member = MemberShape.builder().id(memberId).target(stringId).build(); ListShape container = ListShape.builder().id(containerId).member(member).build(); Model model = Model.builder() .addShapes(target, member, container) .build(); ModelTransformer transformer = ModelTransformer.create(); MemberShape newMember = MemberShape.builder() .id(memberId) .target(stringId) .addTrait(new SensitiveTrait()) .build(); ListShape newList = ListShape.builder().id(containerId).member(newMember).build(); Model result = transformer.replaceShapes(model, Arrays.asList(newList)); assertThat(result.shapes().count(), Matchers.equalTo(3L)); assertThat(result.getShape(memberId).get().getTrait(SensitiveTrait.class), Matchers.not(Optional.empty())); assertThat(result.getShape(containerId).get(), Matchers.is(newList)); assertThat(result.getShape(containerId).get().asListShape().get().getMember(), Matchers.is(newMember)); }
ReplaceShapes(Collection<Shape> replacements) { this.replacements = Objects.requireNonNull(replacements); }
ReplaceShapes { ReplaceShapes(Collection<Shape> replacements) { this.replacements = Objects.requireNonNull(replacements); } }
ReplaceShapes { ReplaceShapes(Collection<Shape> replacements) { this.replacements = Objects.requireNonNull(replacements); } ReplaceShapes(Collection<Shape> replacements); }
ReplaceShapes { ReplaceShapes(Collection<Shape> replacements) { this.replacements = Objects.requireNonNull(replacements); } ReplaceShapes(Collection<Shape> replacements);  }
ReplaceShapes { ReplaceShapes(Collection<Shape> replacements) { this.replacements = Objects.requireNonNull(replacements); } ReplaceShapes(Collection<Shape> replacements);   }