diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-09-23 09:06:19 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-09-26 08:15:38 +0200 |
commit | 7ad1eb51710b65fdad35fab04122de4eb887e541 (patch) | |
tree | 512a725f33ca65bf211bc4c64ba2bd0d7c49a080 /v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.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/interfaces/TapCustomizerTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java index c2c687602..88232d55f 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java @@ -23,7 +23,6 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; import io.fd.honeycomb.translate.v3po.util.NamingContext; import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest; import org.junit.Test; @@ -74,10 +73,10 @@ public class TapCustomizerTest extends WriterCustomizerTest { tapCustomizer.writeCurrentAttributes(getTapId("tap2"), getTapData("tap2", "ff:ff:ff:ff:ff:ff"), writeContext); verify(api, times(2)).tapConnect(any(TapConnect.class)); - verify(mappingContext).put(eq(ContextTestUtils.getMappingIid("tap", IFC_TEST_INSTANCE)), eq( - ContextTestUtils.getMapping("tap", 0).get())); - verify(mappingContext).put(eq(ContextTestUtils.getMappingIid("tap2", IFC_TEST_INSTANCE)), eq( - ContextTestUtils.getMapping("tap2", 1).get())); + verify(mappingContext).put(eq(mappingIid("tap", IFC_TEST_INSTANCE)), eq( + mapping("tap", 0).get())); + verify(mappingContext).put(eq(mappingIid("tap2", IFC_TEST_INSTANCE)), eq( + mapping("tap2", 1).get())); } @Test @@ -92,14 +91,14 @@ public class TapCustomizerTest extends WriterCustomizerTest { tapCustomizer.writeCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), writeContext); - ContextTestUtils.mockMapping(mappingContext, "tap", 1, IFC_TEST_INSTANCE); + defineMapping(mappingContext, "tap", 1, IFC_TEST_INSTANCE); tapCustomizer.updateCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), getTapData("tap", "ff:ff:ff:ff:ff:f1"), writeContext); verify(api).tapConnect(any(TapConnect.class)); verify(api).tapModify(any(TapModify.class)); - verify(mappingContext).put(eq(ContextTestUtils.getMappingIid("tap", IFC_TEST_INSTANCE)), eq( - ContextTestUtils.getMapping("tap", 0).get())); + verify(mappingContext).put(eq(mappingIid("tap", IFC_TEST_INSTANCE)), eq( + mapping("tap", 0).get())); } @Test @@ -111,12 +110,12 @@ public class TapCustomizerTest extends WriterCustomizerTest { doReturn(future(new TapDeleteReply())).when(api).tapDelete(any(TapDelete.class)); tapCustomizer.writeCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), writeContext); - ContextTestUtils.mockMapping(mappingContext, "tap", 1, IFC_TEST_INSTANCE); + defineMapping(mappingContext, "tap", 1, IFC_TEST_INSTANCE); tapCustomizer.deleteCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), writeContext); verify(api).tapConnect(any(TapConnect.class)); verify(api).tapDelete(any(TapDelete.class)); - verify(mappingContext).delete(eq(ContextTestUtils.getMappingIid("tap", IFC_TEST_INSTANCE))); + verify(mappingContext).delete(eq(mappingIid("tap", IFC_TEST_INSTANCE))); } private InstanceIdentifier<Tap> getTapId(final String tap) { |