X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FRestPostOperationTest.java;h=af9dd283594ea3943f9265e5a2ecade495a85e7f;hp=5b36fd52f78c329649fb3d593034d6bf028031f0;hb=f8225a74b7c11db1ebf77ab9de998c2e953f8ed8;hpb=03ee21b4d6ae3dd6fd3a6991253e877dc96fabf5 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java index 5b36fd52f7..af9dd28359 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java @@ -37,7 +37,6 @@ import org.junit.BeforeClass; 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; @@ -52,7 +51,7 @@ import org.opendaylight.controller.sal.restconf.impl.ControllerContext; 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; @@ -125,10 +124,12 @@ public class RestPostOperationTest extends JerseyTest { assertEquals(500, post(uri, MediaType.APPLICATION_XML, xmlDataRpcInput)); List 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)); @@ -198,8 +199,8 @@ public class RestPostOperationTest extends JerseyTest { builder.errors(errors); } RpcResult rpcResult = builder.build(); - when(brokerFacade.invokeRpc(any(QName.class), any(CompositeNode.class))) - .thenReturn(Futures.> immediateFuture(rpcResult)); + when(brokerFacade.invokeRpc(any(QName.class), any(CompositeNode.class))).thenReturn( + Futures.> immediateFuture(rpcResult)); } private void mockInvokeRpc(CompositeNode result, boolean sucessful) {