Bug-5543 - Bo: Update JUnit tests part 11 95/40695/4
authormiroslav.macko <miroslav.macko@pantheon.tech>
Wed, 22 Jun 2016 11:51:14 +0000 (13:51 +0200)
committerMiroslav Macko <miroslav.macko@pantheon.tech>
Fri, 1 Jul 2016 08:57:21 +0000 (08:57 +0000)
Added tests for openflowplugin-extension-nicira

Change-Id: I3f77e2bb41f17b6ae1a29572241ca549830781ad
Signed-off-by: miroslav.macko <miroslav.macko@pantheon.tech>
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProviderTest.java [new file with mode: 0644]

diff --git a/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProviderTest.java b/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProviderTest.java
new file mode 100644 (file)
index 0000000..1ac9630
--- /dev/null
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.extension.vendor.nicira;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
+import org.opendaylight.openflowplugin.extension.api.ExtensionConverterRegistrator;
+import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
+
+/**
+ * Test for {@link NiciraExtensionProvider}.
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class NiciraExtensionProviderTest {
+
+    @Mock
+    private ExtensionConverterRegistrator extensionConverterRegistrator;
+
+    private NiciraExtensionProvider niciraExtensionProvider;
+
+    @Before
+    public void setUp() throws Exception {
+
+        niciraExtensionProvider = new NiciraExtensionProvider();
+        niciraExtensionProvider.setExtensionConverterRegistrator(extensionConverterRegistrator);
+    }
+
+    @Test
+    public void testRegisterConverters() throws Exception {
+        niciraExtensionProvider.registerConverters();
+        Mockito.verify(extensionConverterRegistrator, Mockito.atLeastOnce()).registerActionConvertor(Matchers.<TypeVersionKey<? extends Action>>any(), Matchers.<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action>>any());
+    }
+}
\ No newline at end of file