Add support for reusable streaming
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / test / java / org / opendaylight / controller / remote / rpc / RemoteRpcProviderFactoryTest.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. 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 package org.opendaylight.controller.remote.rpc;
9
10 import static org.mockito.MockitoAnnotations.initMocks;
11
12 import akka.actor.ActorSystem;
13 import org.junit.Assert;
14 import org.junit.Before;
15 import org.junit.Test;
16 import org.mockito.Mock;
17 import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
18 import org.opendaylight.mdsal.dom.api.DOMRpcService;
19
20 public class RemoteRpcProviderFactoryTest {
21
22     @Mock
23     private DOMRpcProviderService providerService;
24     @Mock
25     private DOMRpcService rpcService;
26     @Mock
27     private ActorSystem actorSystem;
28     @Mock
29     private RemoteRpcProviderConfig providerConfig;
30
31     @Before
32     public void setUp() {
33         initMocks(this);
34     }
35
36     @Test
37     public void testCreateInstance() {
38         Assert.assertNotNull(RemoteRpcProviderFactory
39                 .createInstance(providerService, rpcService, actorSystem, providerConfig));
40     }
41
42     @Test(expected = NullPointerException.class)
43     public void testCreateInstanceMissingProvideService() {
44         RemoteRpcProviderFactory.createInstance(null, rpcService, actorSystem, providerConfig);
45     }
46
47     @Test(expected = NullPointerException.class)
48     public void testCreateInstanceMissingRpcService() {
49         RemoteRpcProviderFactory.createInstance(providerService, null, actorSystem, providerConfig);
50     }
51
52     @Test(expected = NullPointerException.class)
53     public void testCreateInstanceMissingActorSystem() {
54         RemoteRpcProviderFactory.createInstance(providerService, rpcService, null, providerConfig);
55     }
56
57     @Test(expected = NullPointerException.class)
58     public void testCreateInstanceMissingProviderConfig() {
59         RemoteRpcProviderFactory.createInstance(providerService, rpcService, actorSystem, null);
60     }
61 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.