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%2FRestPutOperationTest.java;h=f70af4e4f6193f5ee43f8f8dbe8e3cdffe8e6d45;hp=ac1820abea752e41a1078acc94d6bb1c4d36c3dc;hb=1447e0132075bbd3013aa41b98384a373bd82d1a;hpb=cfa5167ef6c97854974a1209b20a19cb9b88ff59 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutOperationTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutOperationTest.java index ac1820abea..f70af4e4f6 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutOperationTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutOperationTest.java @@ -13,6 +13,7 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + import com.google.common.base.Optional; import com.google.common.util.concurrent.CheckedFuture; import java.io.FileNotFoundException; @@ -112,6 +113,7 @@ public class RestPutOperationTest extends JerseyTest { @Test public void putConfigStatusCodesEmptyBody() throws UnsupportedEncodingException { final String uri = "/config/ietf-interfaces:interfaces/interface/eth0"; + @SuppressWarnings("unused") final Response resp = target(uri).request(MediaType.APPLICATION_JSON).put( Entity.entity("", MediaType.APPLICATION_JSON)); assertEquals(400, put(uri, MediaType.APPLICATION_JSON, "")); @@ -122,6 +124,7 @@ public class RestPutOperationTest extends JerseyTest { public void testRpcResultCommitedToStatusCodesWithMountPoint() throws UnsupportedEncodingException, FileNotFoundException, URISyntaxException { + @SuppressWarnings("unchecked") final CheckedFuture dummyFuture = mock(CheckedFuture.class); when( @@ -144,6 +147,7 @@ public class RestPutOperationTest extends JerseyTest { @Test public void putDataMountPointIntoHighestElement() throws UnsupportedEncodingException, URISyntaxException { + @SuppressWarnings("unchecked") final CheckedFuture dummyFuture = mock(CheckedFuture.class); when( brokerFacade.commitConfigurationDataPut(any(DOMMountPoint.class), any(YangInstanceIdentifier.class), @@ -167,13 +171,13 @@ public class RestPutOperationTest extends JerseyTest { doThrow(OptimisticLockFailedException.class). when(brokerFacade).commitConfigurationDataPut( - any(YangInstanceIdentifier.class), any(NormalizedNode.class)); + any(SchemaContext.class), any(YangInstanceIdentifier.class), any(NormalizedNode.class)); assertEquals(500, put(uri, MediaType.APPLICATION_XML, xmlData)); doThrow(OptimisticLockFailedException.class).doReturn(mock(CheckedFuture.class)). when(brokerFacade).commitConfigurationDataPut( - any(YangInstanceIdentifier.class), any(NormalizedNode.class)); + any(SchemaContext.class), any(YangInstanceIdentifier.class), any(NormalizedNode.class)); assertEquals(200, put(uri, MediaType.APPLICATION_XML, xmlData)); } @@ -186,7 +190,7 @@ public class RestPutOperationTest extends JerseyTest { doThrow(TransactionCommitFailedException.class). when(brokerFacade).commitConfigurationDataPut( - any(YangInstanceIdentifier.class), any(NormalizedNode.class)); + (SchemaContext)null, any(YangInstanceIdentifier.class), any(NormalizedNode.class)); assertEquals(500, put(uri, MediaType.APPLICATION_XML, xmlData)); } @@ -198,10 +202,10 @@ public class RestPutOperationTest extends JerseyTest { private void mockCommitConfigurationDataPutMethod(final boolean noErrors) { if (noErrors) { doReturn(mock(CheckedFuture.class)).when(brokerFacade).commitConfigurationDataPut( - any(YangInstanceIdentifier.class), any(NormalizedNode.class)); + any(SchemaContext.class), any(YangInstanceIdentifier.class), any(NormalizedNode.class)); } else { doThrow(RestconfDocumentedException.class).when(brokerFacade).commitConfigurationDataPut( - any(YangInstanceIdentifier.class), any(NormalizedNode.class)); + any(SchemaContext.class), any(YangInstanceIdentifier.class), any(NormalizedNode.class)); } }