Remove use of CheckedFuture 71/80371/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 18 Feb 2019 17:59:03 +0000 (18:59 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 18 Feb 2019 17:59:03 +0000 (18:59 +0100)
YangTextSchemaSource uses ListenableFuture only, hence we can
remove use of deprecated Futures.immediate(Failed)CheckedFuture().

Change-Id: I40e571441894c49bbea7a8c11a3854505147af3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/schema/provider/impl/RemoteYangTextSourceProviderImplTest.java

index 6a3f2337b8a54dff4941355e91f86a92aeee53ad..1fda858fdd59a5c8c60ebfb0077c6145aa07074a 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.controller.cluster.schema.provider.impl;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -50,7 +49,7 @@ public class RemoteYangTextSourceProviderImplTest {
         YangTextSchemaSource schemaSource = YangTextSchemaSource.delegateForByteSource(
                 ID, ByteSource.wrap(source.getBytes()));
         Mockito.when(mockedLocalRepository.getSchemaSource(ID, YangTextSchemaSource.class)).thenReturn(
-                Futures.immediateCheckedFuture(schemaSource));
+                Futures.immediateFuture(schemaSource));
 
         Future<YangTextSchemaSourceSerializationProxy> retrievedSourceFuture =
                 remoteRepository.getYangTextSchemaSource(ID);
@@ -64,8 +63,7 @@ public class RemoteYangTextSourceProviderImplTest {
     @Test(expected = SchemaSourceException.class)
     public void testGetNonExistentYangTextSchemaSource() throws Exception {
         Mockito.when(mockedLocalRepository.getSchemaSource(ID, YangTextSchemaSource.class)).thenReturn(
-                Futures.immediateFailedCheckedFuture(
-                        new SchemaSourceException("Source is not provided")));
+                Futures.immediateFailedFuture(new SchemaSourceException("Source is not provided")));
 
         Future<YangTextSchemaSourceSerializationProxy> retrievedSourceFuture =
                 remoteRepository.getYangTextSchemaSource(ID);