use of org.opennms.core.rpc.echo.EchoResponse in project opennms by OpenNMS.
the class EchoRpcIT method canExecuteRpcViaAnotherLocationWithSystemId.
@Test(timeout = 60000)
public void canExecuteRpcViaAnotherLocationWithSystemId() throws Exception {
assertNotEquals(REMOTE_LOCATION_NAME, identity.getLocation());
EchoRpcModule echoRpcModule = new EchoRpcModule();
CamelContext context = getContext();
context.start();
MinionIdentity minionIdentity = new MockMinionIdentity(REMOTE_LOCATION_NAME);
CamelRpcServerRouteManager routeManager = getRouteManager(context);
routeManager.bind(echoRpcModule);
EchoRequest request = new EchoRequest("HELLO!!!");
// Specify the system id
assertNotNull(minionIdentity.getId());
request.setSystemId(minionIdentity.getId());
request.setLocation(REMOTE_LOCATION_NAME);
EchoResponse expectedResponse = new EchoResponse("HELLO!!!");
EchoResponse actualResponse = echoClient.execute(request).get();
assertEquals(expectedResponse, actualResponse);
routeManager.unbind(echoRpcModule);
context.stop();
}
Aggregations