use of org.opendaylight.netconf.topology.singleton.impl.netconf.NetconfServiceFailedException in project netconf by opendaylight.
the class NetconfDataTreeServiceActorTest method testCommitFail.
@Test
public void testCommitFail() {
final RpcError rpcError = RpcResultBuilder.newError(RpcError.ErrorType.APPLICATION, "fail", "fail");
final TransactionCommitFailedException failure = new TransactionCommitFailedException("fail", rpcError);
final NetconfServiceFailedException cause = new NetconfServiceFailedException(String.format("%s: Commit of operation failed", 1), failure);
when(netconfService.commit()).thenReturn(FluentFutures.immediateFailedFluentFuture(cause));
actorRef.tell(new CommitRequest(), probe.ref());
verify(netconfService).commit();
final Status.Failure response = probe.expectMsgClass(Status.Failure.class);
assertEquals(cause, response.cause());
}
Aggregations