Remove redundant exception declarations
[openflowplugin.git] / extension / openflowplugin-extension-nicira / src / test / java / org / opendaylight / openflowplugin / extension / vendor / nicira / convertor / action / CtClearConvertorTest.java
1 /**
2  * Copyright (c) 2018 Redhat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
10
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.Test;
14 import org.junit.runner.RunWith;
15 import org.mockito.Mock;
16 import org.mockito.Mockito;
17 import org.mockito.runners.MockitoJUnitRunner;
18 import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionCtClear;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.ct.clear.grouping.NxActionCtClear;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionCtClearNodesNodeTableFlowWriteActionsCase;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.ct.clear.grouping.NxCtClear;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
26
27 /**
28  * Test for {@link CtClearConvertor}.
29  */
30 @RunWith(MockitoJUnitRunner.class)
31 public class CtClearConvertorTest {
32
33     private static final Logger LOG = LoggerFactory.getLogger(CtClearConvertorTest.class);
34
35     @Mock
36     private NxActionCtClearNodesNodeTableFlowWriteActionsCase actionsCase;
37
38     @Mock
39     private Action action;
40
41     private CtClearConvertor ctClearConvertor;
42
43     @Before
44     public void setUp() {
45         final NxCtClear nxCtClear = Mockito.mock(NxCtClear.class);
46
47         final ActionCtClear actionCtClear = Mockito.mock(ActionCtClear.class);
48         final NxActionCtClear nxActionCtClear = Mockito.mock(NxActionCtClear.class);
49
50         ctClearConvertor = new CtClearConvertor();
51     }
52
53     @Test
54     public void testConvert() {
55         final ActionCtClear actionCtClear = (ActionCtClear) ctClearConvertor.convert(actionsCase).getActionChoice();
56         Assert.assertNotNull(actionCtClear);
57     }
58
59     @Test
60     public void testConvert1() {
61         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
62                 = ctClearConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
63         Assert.assertNotNull(actionResult);
64         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
65                 = ctClearConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
66         Assert.assertNotNull(actionResult1);
67         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult2
68                 = ctClearConvertor.convert(action, ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
69         Assert.assertNotNull(actionResult2);
70         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult3
71                 = ctClearConvertor.convert(action, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
72         Assert.assertNotNull(actionResult3);
73         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult4
74                 = ctClearConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
75         Assert.assertNotNull(actionResult4);
76         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult5
77                 = ctClearConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
78         Assert.assertNotNull(actionResult5);
79     }
80 }