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;
@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();
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());
}