@Test public void testBundleAddBuilderWithParent() { OFBundleAddMsg bundleAdd = createBundleAdd(); // validate BuilderWithParent OFBundleAddMsg builtFromOtherMessage = bundleAdd.createBuilder() .build(); assertThat(builtFromOtherMessage.getXid(), equalTo(builtFromOtherMessage.getData().getXid())); }
@Test public void testBundleAddBuilderWithParentOverwrite() { OFFlowAdd flowAdd2 = factory.buildFlowAdd().setXid(1234L).build(); // BuilderWithParent, overwrite with new message OFBundleAddMsg bundleAdd = createBundleAdd(); OFBundleAddMsg builtFromOtherMessage = bundleAdd.createBuilder() .setData(flowAdd2) .build(); assertThat(builtFromOtherMessage.getXid(), equalTo(flowAdd2.getXid())); }
@Test public void testBundleAddBuilder() { OFBundleAddMsg bundleAdd = createBundleAdd(); assertThat(bundleAdd.getXid(), equalTo(flowAdd.getXid())); }
private OFBundleAddMsg createBundleAdd() { return factory.buildBundleAddMsg() .setBundleId(BundleId.of(1)) .setData(flowAdd) .build(); }