OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / openflowplugin / src / test / java / org / opendaylight / openflowplugin / openflow / md / core / extension / ActionExtensionHelperTest.java
index 09f3e822c70c3a3b7df5c5c1e788f802f33839d0..472990d71676411d360ca3bfd37d06b2bf402189 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.openflowplugin.openflow.md.core.extension;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 
 import org.junit.Before;
@@ -44,18 +44,11 @@ public class ActionExtensionHelperTest {
     @Before
     public void setup() {
         OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterProvider);
-        when(extensionConverterProvider.getActionConverter(any(MessageTypeKey.class))).thenReturn(new ConvertorActionFromOFJava<DataContainer, AugmentationPath>() {
-            @Override
-            public Action convert(DataContainer input, AugmentationPath path) {
-                return new MockAction();
-            }
-        });
+        when(extensionConverterProvider.getActionConverter(any(MessageTypeKey.class)))
+            .thenReturn((ConvertorActionFromOFJava<DataContainer, AugmentationPath>) (input, path) -> new MockAction());
     }
 
     @Test
-    /**
-     * Trivial test for {@link ActionExtensionHelper#processAlienAction(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action, org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion, org.opendaylight.openflowplugin.extension.api.path.ActionPath)}
-     */
     public void testProcessAlienAction() {
         ActionBuilder actionBuilder = new ActionBuilder();
 
@@ -65,7 +58,8 @@ public class ActionExtensionHelperTest {
         experimenterBuilder.setExperimenter(new ExperimenterId(42L));
         experimenterIdCaseBuilder.setExperimenter(experimenterBuilder.build());
         actionBuilder.setActionChoice(experimenterIdCaseBuilder.build());
-        Action action = ActionExtensionHelper.processAlienAction(actionBuilder.build(), OpenflowVersion.OF13, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+        Action action = ActionExtensionHelper.processAlienAction(actionBuilder.build(), OpenflowVersion.OF13,
+                ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         assertNotNull(action);
         assertEquals(MockAction.class, action.getImplementedInterface());
     }