Decompose RPC implementation classes
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / services / sal / SendExperimenterMpRequestImplTest.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.openflowplugin.impl.services.sal;
9
10 import static org.mockito.Mockito.verify;
11
12 import java.util.List;
13 import org.junit.Test;
14 import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
18
19 public class SendExperimenterMpRequestImplTest extends ServiceMocking {
20     private SendExperimenterMpRequestImpl sendExperimenterMpRequest;
21
22     @Override
23     protected void setup() {
24         this.<List<MultipartReply>>mockSuccessfulFuture();
25
26         sendExperimenterMpRequest = new SendExperimenterMpRequestImpl(mockedRequestContextStack, mockedDeviceContext,
27             mockedExtensionConverterProvider);
28     }
29
30     @Test
31     public void sendExperimenterMpRequest() {
32         sendExperimenterMpRequest.invoke(new SendExperimenterMpRequestInputBuilder()
33             .setExperimenterMessageOfChoice(mockExperimenter())
34             .setNode(new NodeRef(mockedDeviceInfo.getNodeInstanceIdentifier()))
35             .build());
36         verify(mockedRequestContextStack).createRequestContext();
37     }
38 }