import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-import org.opendaylight.controller.sal.common.util.RpcErrors;
import org.opendaylight.controller.sal.core.api.mount.MountInstance;
import org.opendaylight.controller.sal.core.api.mount.MountService;
import org.opendaylight.controller.sal.rest.api.Draft02;
import org.opendaylight.controller.sal.restconf.impl.RestconfImpl;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.RpcError;
-import org.opendaylight.yangtools.yang.common.RpcError.ErrorSeverity;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
assertEquals(500, post(uri, MediaType.APPLICATION_XML, xmlDataRpcInput));
List<RpcError> rpcErrors = new ArrayList<>();
- rpcErrors.add( RpcErrors.getRpcError("applicationTag1", "tag1", "info1", ErrorSeverity.ERROR, "message1", ErrorType.RPC, null));
- rpcErrors.add( RpcErrors.getRpcError("applicationTag2", "tag2", "info2", ErrorSeverity.WARNING, "message2", ErrorType.PROTOCOL, null));
+ rpcErrors.add( RpcResultBuilder.newError( ErrorType.RPC, "tag1", "message1",
+ "applicationTag1", "info1", null ) );
+ rpcErrors.add( RpcResultBuilder.newWarning( ErrorType.PROTOCOL, "tag2", "message2",
+ "applicationTag2", "info2", null ) );
mockInvokeRpc(null, false, rpcErrors);
- assertEquals(500,post(uri, MediaType.APPLICATION_XML, xmlDataRpcInput));
+ assertEquals(500, post(uri, MediaType.APPLICATION_XML, xmlDataRpcInput));
uri = "/operations/test-module:rpc-wrongtest";
assertEquals(400, post(uri, MediaType.APPLICATION_XML, xmlDataRpcInput));
builder.errors(errors);
}
RpcResult<CompositeNode> rpcResult = builder.build();
- when(brokerFacade.invokeRpc(any(QName.class), any(CompositeNode.class)))
- .thenReturn(Futures.<RpcResult<CompositeNode>> immediateFuture(rpcResult));
+ when(brokerFacade.invokeRpc(any(QName.class), any(CompositeNode.class))).thenReturn(
+ Futures.<RpcResult<CompositeNode>> immediateFuture(rpcResult));
}
private void mockInvokeRpc(CompositeNode result, boolean sucessful) {