diff options
author | 2016-09-23 09:06:19 +0200 | |
---|---|---|
committer | 2016-09-26 08:15:38 +0200 | |
commit | 7ad1eb51710b65fdad35fab04122de4eb887e541 (patch) | |
tree | 512a725f33ca65bf211bc4c64ba2bd0d7c49a080 /v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java | |
parent | a7147d16c31d9028c6b5dc557264433de0f11c91 (diff) |
HONEYCOMB-116: utility for stubbing MappingContext methods
- introduces MappingContextHelper (refactored ContextTestUtils)
- updates all v3po and lisp unit tests to use MCH
- updates lisp tests to mock EidMappingContext
Change-Id: I73b1adda767db71388ca1c4d7206cfd7ee9c70e1
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java index b8013b59e..8cd8edad3 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java @@ -36,7 +36,7 @@ import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.read.registry.ReaderRegistry; import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; -import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.vpp.test.util.NamingContextHelper; import io.fd.honeycomb.translate.v3po.util.NamingContext; import io.fd.honeycomb.vpp.test.util.FutureProducer; import java.util.Arrays; @@ -72,7 +72,7 @@ import org.openvpp.jvpp.core.dto.ShowVersion; import org.openvpp.jvpp.core.dto.ShowVersionReply; import org.openvpp.jvpp.core.future.FutureJVppCore; -public class VppStateTest implements FutureProducer { +public class VppStateTest implements FutureProducer, NamingContextHelper { private static final String BD_CTX_NAME = "bd-test-instance"; @Mock @@ -226,7 +226,7 @@ public class VppStateTest implements FutureProducer { bd.bdId = 0; final String bdName = "bdn1"; mockBdMapping(bd, bdName); - ContextTestUtils.mockMapping(mappingContext, "eth1", 0, "ifc-test-instance"); + defineMapping(mappingContext, "eth1", 0, "ifc-test-instance"); whenBridgeDomainDumpThenReturn(Collections.singletonList(bd)); final L2FibTableEntry l2FibEntry = new L2FibTableEntry(); @@ -253,7 +253,7 @@ public class VppStateTest implements FutureProducer { } private void mockBdMapping(final BridgeDomainDetails bd, final String bdName) { - ContextTestUtils.mockMapping(mappingContext, bdName, bd.bdId, BD_CTX_NAME); + defineMapping(mappingContext, bdName, bd.bdId, BD_CTX_NAME); } @Test @@ -301,7 +301,7 @@ public class VppStateTest implements FutureProducer { @Test(expected = ReadFailedException.class) public void testReadBridgeDomainNotExisting() throws Exception { final String nonExistingBdName = "NOT EXISTING"; - ContextTestUtils.mockEmptyMapping(mappingContext, nonExistingBdName, BD_CTX_NAME); + noMappingDefined(mappingContext, nonExistingBdName, BD_CTX_NAME); readerRegistry.read(InstanceIdentifier.create(VppState.class).child(BridgeDomains.class).child( BridgeDomain.class, new BridgeDomainKey(nonExistingBdName)), ctx); |