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=423825827a4749f559f4b831fad5a71c98338750;hp=97cd67d34b70095a1571c1384e4a0e46c61f155a;hb=bfcc4fd3a238b227e246cb869558d707dadcdb34;hpb=eb887b1c2c8cd2768f8b4c2ed2b5054f97798466 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 97cd67d34b..423825827a 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 @@ -16,8 +16,8 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opendaylight.controller.sal.restconf.impl.test.RestOperationUtils.XML; - import com.google.common.base.Optional; +import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; import java.io.IOException; @@ -188,7 +188,7 @@ public class RestPostOperationTest extends JerseyTest { assertEquals(400, post(uri, MediaType.APPLICATION_JSON, "")); } - private void mockInvokeRpc(CompositeNode result, boolean sucessful, Collection errors) { + private void mockInvokeRpc(final CompositeNode result, final boolean sucessful, final Collection errors) { DummyRpcResult.Builder builder = new DummyRpcResult.Builder().result(result) .isSuccessful(sucessful); @@ -200,7 +200,7 @@ public class RestPostOperationTest extends JerseyTest { Futures.> immediateFuture(rpcResult)); } - private void mockInvokeRpc(CompositeNode result, boolean sucessful) { + private void mockInvokeRpc(final CompositeNode result, final boolean sucessful) { mockInvokeRpc(result, sucessful, Collections. emptyList()); } @@ -229,14 +229,14 @@ public class RestPostOperationTest extends JerseyTest { assertEquals(204, post(URI_1, Draft02.MediaTypes.DATA + XML, xmlTestInterface)); verify(brokerFacade).commitConfigurationDataPost(instanceIdCaptor.capture(), compNodeCaptor.capture()); String identifier = "[(urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)interfaces]"; - assertEquals(identifier, instanceIdCaptor.getValue().getPath().toString()); + assertEquals(identifier, ImmutableList.copyOf(instanceIdCaptor.getValue().getPathArguments()).toString()); String URI_2 = "/config/test-interface:interfaces"; assertEquals(204, post(URI_2, Draft02.MediaTypes.DATA + XML, xmlBlockData)); verify(brokerFacade, times(2)) .commitConfigurationDataPost(instanceIdCaptor.capture(), compNodeCaptor.capture()); identifier = "[(urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)interfaces, (urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)block]"; - assertEquals(identifier, instanceIdCaptor.getValue().getPath().toString()); + assertEquals(identifier, ImmutableList.copyOf(instanceIdCaptor.getValue().getPathArguments()).toString()); } @Test @@ -264,7 +264,7 @@ public class RestPostOperationTest extends JerseyTest { restconfImpl.setControllerContext(controllerContext); } - private int post(String uri, String mediaType, String data) { + private int post(final String uri, final String mediaType, final String data) { return target(uri).request(mediaType).post(Entity.entity(data, mediaType)).getStatus(); }