.build();
final TopLevelList baTree = new TopLevelListBuilder()
.setKey(TOP_FOO_KEY)
- .addAugmentation(TreeComplexUsesAugment.class, new TreeComplexUsesAugmentBuilder(createComplexData()).build())
+ .addAugmentation(TreeComplexUsesAugment.class, new TreeComplexUsesAugmentBuilder(createComplexData())
+ .build())
.build();
final NormalizedNode<?, ?> domTreeEntry = registry.toNormalizedNode(BA_TOP_LEVEL_LIST, baTree).getValue();
final NormalizedNode<?, ?> domRpcEntry = registry.toNormalizedNode(BA_TOP_LEVEL_LIST, baRpc).getValue();
public void copyBuilderWithAugmenationsTest() {
final TopLevelList manuallyConstructed = new TopLevelListBuilder()
.setKey(TOP_FOO_KEY)
- .addAugmentation(TreeComplexUsesAugment.class, new TreeComplexUsesAugmentBuilder(createComplexData()).build())
+ .addAugmentation(TreeComplexUsesAugment.class, new TreeComplexUsesAugmentBuilder(createComplexData())
+ .build())
.build();
- final NormalizedNode<?, ?> domTreeEntry = registry.toNormalizedNode(BA_TOP_LEVEL_LIST, manuallyConstructed).getValue();
- final TopLevelList deserialized = registry.deserializeFunction(BA_TOP_LEVEL_LIST).apply(Optional.<NormalizedNode<?, ?>>of(domTreeEntry)).get();
+ final NormalizedNode<?, ?> domTreeEntry = registry.toNormalizedNode(BA_TOP_LEVEL_LIST, manuallyConstructed)
+ .getValue();
+ final TopLevelList deserialized = registry.deserializeFunction(BA_TOP_LEVEL_LIST)
+ .apply(Optional.of(domTreeEntry)).get();
assertEquals(manuallyConstructed, deserialized);
final TopLevelList copiedFromDeserialized = new TopLevelListBuilder(deserialized).build();
assertEquals(manuallyConstructed, copiedFromDeserialized);
private static RpcComplexUsesAugment createComplexData() {
return new RpcComplexUsesAugmentBuilder()
- .setContainerWithUses(new ContainerWithUsesBuilder()
- .setLeafFromGrouping("foo")
- .build())
- .setListViaUses(Collections.<ListViaUses>emptyList())
- .build();
+ .setContainerWithUses(new ContainerWithUsesBuilder()
+ .setLeafFromGrouping("foo")
+ .build())
+ .setListViaUses(Collections.<ListViaUses>emptyList())
+ .build();
}
-
}