@SuppressWarnings("unchecked") @Test public void testBuildEndpointAugmentation() throws ExecutionException, InterruptedException { Nodes nodes = buildNodes(); ReadOnlyTransaction roTx = mock(ReadOnlyTransaction.class); TransactionMockUtils.setupRoTx(roTx, LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(Nodes.class).build(), true, nodes); when(dataProvider.newReadOnlyTransaction()).thenReturn(roTx); OfOverlayContextInput contextInput = new OfOverlayContextInputBuilder().setPortName(new Name(PORT_NAME)).build(); RegisterEndpointInput input = new RegisterEndpointInputBuilder().addAugmentation(OfOverlayContextInput.class, contextInput).build(); Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> entry = ofOverlayAug.buildEndpointAugmentation(input); assertNotNull(entry); assertNotNull(entry.getValue()); }
@Override public Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> buildEndpointAugmentation( RegisterEndpointInput input) { OfOverlayContextBuilder ictx = checkAugmentation(input); if (ictx != null) { return new SimpleImmutableEntry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>>( OfOverlayContext.class, ictx.build()); } return null; }
OfOverlayAug implements EpRendererAugmentation, AutoCloseable { @Override public Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> buildEndpointAugmentation( RegisterEndpointInput input) { OfOverlayContextBuilder ictx = checkAugmentation(input); if (ictx != null) { return new SimpleImmutableEntry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>>( OfOverlayContext.class, ictx.build()); } return null; } }
OfOverlayAug implements EpRendererAugmentation, AutoCloseable { @Override public Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> buildEndpointAugmentation( RegisterEndpointInput input) { OfOverlayContextBuilder ictx = checkAugmentation(input); if (ictx != null) { return new SimpleImmutableEntry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>>( OfOverlayContext.class, ictx.build()); } return null; } OfOverlayAug(DataBroker dataProvider, EpRendererAugmentationRegistry epRendererAugmentationRegistry); }
OfOverlayAug implements EpRendererAugmentation, AutoCloseable { @Override public Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> buildEndpointAugmentation( RegisterEndpointInput input) { OfOverlayContextBuilder ictx = checkAugmentation(input); if (ictx != null) { return new SimpleImmutableEntry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>>( OfOverlayContext.class, ictx.build()); } return null; } OfOverlayAug(DataBroker dataProvider, EpRendererAugmentationRegistry epRendererAugmentationRegistry); @Override Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> buildEndpointAugmentation(
            RegisterEndpointInput input); @Override Map.Entry<Class<? extends Augmentation<EndpointL3>>, Augmentation<EndpointL3>> buildEndpointL3Augmentation(
            RegisterEndpointInput input); @Override Map.Entry<Class<? extends Augmentation<EndpointL3Prefix>>, Augmentation<EndpointL3Prefix>> buildL3PrefixEndpointAugmentation(
            RegisterL3PrefixEndpointInput input); @Override void close(); }
OfOverlayAug implements EpRendererAugmentation, AutoCloseable { @Override public Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> buildEndpointAugmentation( RegisterEndpointInput input) { OfOverlayContextBuilder ictx = checkAugmentation(input); if (ictx != null) { return new SimpleImmutableEntry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>>( OfOverlayContext.class, ictx.build()); } return null; } OfOverlayAug(DataBroker dataProvider, EpRendererAugmentationRegistry epRendererAugmentationRegistry); @Override Map.Entry<Class<? extends Augmentation<Endpoint>>, Augmentation<Endpoint>> buildEndpointAugmentation(
            RegisterEndpointInput input); @Override Map.Entry<Class<? extends Augmentation<EndpointL3>>, Augmentation<EndpointL3>> buildEndpointL3Augmentation(
            RegisterEndpointInput input); @Override Map.Entry<Class<? extends Augmentation<EndpointL3Prefix>>, Augmentation<EndpointL3Prefix>> buildL3PrefixEndpointAugmentation(
            RegisterL3PrefixEndpointInput input); @Override void close();  }