summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java
index 4842f5de4..8c67735aa 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/ip/SubInterfaceIpv4AddressCustomizerTest.java
@@ -29,13 +29,13 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.google.common.collect.ImmutableSet;
+import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest;
+import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
import io.fd.honeycomb.translate.util.read.cache.CacheKeyFactory;
-import io.fd.honeycomb.translate.util.read.cache.IdentifierCacheKeyFactory;
-import io.fd.hc2vpp.common.translate.util.Ipv4Translator;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest;
+import io.fd.honeycomb.translate.util.read.cache.TypeAwareIdentifierCacheKeyFactory;
import io.fd.vpp.jvpp.core.dto.IpAddressDetails;
import io.fd.vpp.jvpp.core.dto.IpAddressDetailsReplyDump;
import java.util.Arrays;
@@ -76,19 +76,26 @@ public class SubInterfaceIpv4AddressCustomizerTest extends ListReaderCustomizerT
.augmentation(SubinterfaceStateAugmentation.class)
.child(SubInterfaces.class).child(SubInterface.class, new SubInterfaceKey(SUB_IF_ID))
.child(Ipv4.class);
- private InstanceIdentifier<Address> ifaceOneAddressOneIdentifier;
- private InstanceIdentifier<Address> ifaceTwoAddressOneIdentifier;
- private CacheKeyFactory cacheKeyFactory;
private static final Ipv4AddressNoZone IP1 = new Ipv4AddressNoZone("10.1.1.1");
private static final Ipv4AddressNoZone IP2 = new Ipv4AddressNoZone("10.1.1.2");
private static final short PREFIX_LENGTH = 16;
-
+ private InstanceIdentifier<Address> ifaceOneAddressOneIdentifier;
+ private InstanceIdentifier<Address> ifaceTwoAddressOneIdentifier;
+ private CacheKeyFactory cacheKeyFactory;
private NamingContext interfaceContext;
public SubInterfaceIpv4AddressCustomizerTest() {
super(Address.class, Ipv4Builder.class);
}
+ private static InstanceIdentifier<Address> getId() {
+ return IP4_IID.child(Address.class);
+ }
+
+ private static InstanceIdentifier<Address> getId(final Ipv4AddressNoZone ip) {
+ return IP4_IID.child(Address.class, new AddressKey(ip));
+ }
+
@Override
protected void setUp() throws Exception {
interfaceContext = new NamingContext("generatedIfaceName", IFC_CTX_NAME);
@@ -109,7 +116,8 @@ public class SubInterfaceIpv4AddressCustomizerTest extends ListReaderCustomizerT
.child(Address.class, new AddressKey(new Ipv4AddressNoZone("192.168.2.1")));
// to simulate complex key
- cacheKeyFactory = new IdentifierCacheKeyFactory(ImmutableSet.of(SubInterface.class));
+ cacheKeyFactory = new TypeAwareIdentifierCacheKeyFactory(IpAddressDetailsReplyDump.class,
+ ImmutableSet.of(SubInterface.class));
defineMapping(mappingContext, IF_NAME, IF_INDEX, IFC_CTX_NAME);
defineMapping(mappingContext, SUB_IF_NAME, SUB_IF_INDEX, IFC_CTX_NAME);
@@ -121,14 +129,6 @@ public class SubInterfaceIpv4AddressCustomizerTest extends ListReaderCustomizerT
return new SubInterfaceIpv4AddressCustomizer(api, interfaceContext);
}
- private static InstanceIdentifier<Address> getId() {
- return IP4_IID.child(Address.class);
- }
-
- private static InstanceIdentifier<Address> getId(final Ipv4AddressNoZone ip) {
- return IP4_IID.child(Address.class, new AddressKey(ip));
- }
-
@Test
public void testRead() throws ReadFailedException {
final AddressBuilder builder = mock(AddressBuilder.class);