private class AnswerImpl implements Answer<RpcResult<CompositeNode>> {
@Override
- public RpcResult<CompositeNode> answer(InvocationOnMock invocation) throws Throwable {
+ public RpcResult<CompositeNode> answer(final InvocationOnMock invocation) throws Throwable {
CompositeNode compNode = (CompositeNode) invocation.getArguments()[1];
return new DummyRpcResult.Builder<CompositeNode>().result(compNode).isSuccessful(true).build();
}
TestUtils.buildQName("cont", "nmspc", "2013-12-04"), null, null, ModifyAction.CREATE, null);
MutableSimpleNode<?> lf = NodeFactory.createMutableSimpleNode(
TestUtils.buildQName("lf", "nmspc", "2013-12-04"), cont, "any value", ModifyAction.CREATE, null);
- cont.getChildren().add(lf);
+ cont.getValue().add(lf);
cont.init();
return cont;
} catch (ResponseException e) {
assertEquals(e.getMessage(),
Status.INTERNAL_SERVER_ERROR.getStatusCode(), e
- .getResponse().getStatus());
+ .getResponse().getStatus());
}
}
} catch (ResponseException e) {
assertEquals(e.getMessage(),
Status.UNSUPPORTED_MEDIA_TYPE.getStatusCode(), e
- .getResponse().getStatus());
+ .getResponse().getStatus());
}
}
BrokerFacade brokerFacade = mock(BrokerFacade.class);
when( brokerFacade.invokeRpc(
- eq(QName.create("(http://netconfcentral.org/ns/toaster?revision=2009-11-20)testOutput")),
- any( CompositeNode.class ))).thenReturn(rpcResult);
+ eq(QName.create("(http://netconfcentral.org/ns/toaster?revision=2009-11-20)testOutput")),
+ any( CompositeNode.class ))).thenReturn(rpcResult);
restconfImpl.setBroker(brokerFacade);
MountInstance mockMountPoint = mock( MountInstance.class );
when( mockMountPoint.rpc( eq( cancelToastQName ), any( CompositeNode.class ) ) )
- .thenReturn( mockListener );
+ .thenReturn( mockListener );
InstanceIdWithSchemaNode mockedInstanceId = mock( InstanceIdWithSchemaNode.class );
when( mockedInstanceId.getMountPoint() ).thenReturn( mockMountPoint );
restconfImpl.setControllerContext( mockedContext );
StructuredData output = restconfImpl.invokeRpc(
- "opendaylight-inventory:nodes/node/REMOTE_HOST/yang-ext:mount/toaster:cancel-toast",
- "");
+ "opendaylight-inventory:nodes/node/REMOTE_HOST/yang-ext:mount/toaster:cancel-toast",
+ "");
assertEquals(null, output);
//additional validation in the fact that the restconfImpl does not throw an exception.