use of org.opendaylight.controller.cluster.access.commands.ConnectClientFailure in project controller by opendaylight.
the class ModuleShardBackendResolverTest method testGetBackendInfoFail.
@Test
public void testGetBackendInfoFail() throws Exception {
final CompletionStage<ShardBackendInfo> i = moduleShardBackendResolver.getBackendInfo(0L);
final ConnectClientRequest req = contextProbe.expectMsgClass(ConnectClientRequest.class);
final RuntimeException cause = new RuntimeException();
final ConnectClientFailure response = req.toRequestFailure(new RuntimeRequestException("fail", cause));
contextProbe.reply(response);
final CompletionStage<ShardBackendInfo> stage = moduleShardBackendResolver.getBackendInfo(0L);
final ExecutionException caught = TestUtils.assertOperationThrowsException(() -> TestUtils.getWithTimeout(stage.toCompletableFuture()), ExecutionException.class);
Assert.assertEquals(cause, caught.getCause());
}
Aggregations