Bug-5543 - Bo: Update JUnit tests part 11
[openflowplugin.git] / extension / openflowplugin-extension-nicira / src / test / java / org / opendaylight / openflowplugin / extension / vendor / nicira / NiciraExtensionProviderTest.java
1 /**
2  * Copyright (c) 2016 Cisco Systems, 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;
10
11 import org.junit.After;
12 import org.junit.Before;
13 import org.junit.Test;
14 import org.junit.runner.RunWith;
15 import org.mockito.Matchers;
16 import org.mockito.Mock;
17 import org.mockito.Mockito;
18 import org.mockito.runners.MockitoJUnitRunner;
19 import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
20 import org.opendaylight.openflowplugin.extension.api.ExtensionConverterRegistrator;
21 import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
23
24 /**
25  * Test for {@link NiciraExtensionProvider}.
26  */
27 @RunWith(MockitoJUnitRunner.class)
28 public class NiciraExtensionProviderTest {
29
30     @Mock
31     private ExtensionConverterRegistrator extensionConverterRegistrator;
32
33     private NiciraExtensionProvider niciraExtensionProvider;
34
35     @Before
36     public void setUp() throws Exception {
37
38         niciraExtensionProvider = new NiciraExtensionProvider();
39         niciraExtensionProvider.setExtensionConverterRegistrator(extensionConverterRegistrator);
40     }
41
42     @Test
43     public void testRegisterConverters() throws Exception {
44         niciraExtensionProvider.registerConverters();
45         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());
46     }
47 }