Teach sal-remoterpc-connector to route actions
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / test / java / org / opendaylight / controller / remote / rpc / messages / ExecuteOpsTest.java
1 /*
2  * Copyright (c) 2019 Nordix Foundation.  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.messages;
9
10 import static org.junit.Assert.assertEquals;
11
12 import org.apache.commons.lang.SerializationUtils;
13 import org.junit.Test;
14 import org.opendaylight.controller.remote.rpc.AbstractOpsTest;
15
16 public class ExecuteOpsTest {
17
18     @Test
19     public void testOpsSerialization() {
20         ExecuteRpc expected = ExecuteRpc.from(AbstractOpsTest.TEST_RPC_ID,
21                 AbstractOpsTest.makeRPCInput("serialization-test"));
22
23         ExecuteRpc actual = (ExecuteRpc) SerializationUtils.clone(expected);
24
25         assertEquals("getName", expected.getType(), actual.getType());
26         assertEquals("getInputNormalizedNode", expected.getInput(), actual.getInput());
27         assertEquals("getPath", expected.getType(), actual.getType());
28     }
29 }