Fix various warnings
[netconf.git] / restconf / sal-rest-connector / src / test / java / org / opendaylight / restconf / handlers / SchemaContextHandlerTest.java
index 89aa8fbe1328b4c5696b419c46a59b379ab83621..5eceb84945707f1061932dd7ba8e76c46f07542d 100644 (file)
@@ -16,6 +16,7 @@ import com.google.common.util.concurrent.CheckedFuture;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
@@ -23,7 +24,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 /**
- * Tests for handling {@link SchemaContext}
+ * Tests for handling {@link SchemaContext}.
  */
 public class SchemaContextHandlerTest {
 
@@ -40,10 +41,9 @@ public class SchemaContextHandlerTest {
         Mockito.when(txHandler.get()).thenReturn(domTx);
         final DOMDataWriteTransaction wTx = Mockito.mock(DOMDataWriteTransaction.class);
         Mockito.when(domTx.newWriteOnlyTransaction()).thenReturn(wTx);
-        final CheckedFuture checked = Mockito.mock(CheckedFuture.class);
+        final CheckedFuture<Void,TransactionCommitFailedException> checked = Mockito.mock(CheckedFuture.class);
         Mockito.when(wTx.submit()).thenReturn(checked);
-        final Object value = null;
-        Mockito.when(checked.checkedGet()).thenReturn(value);
+        Mockito.when(checked.checkedGet()).thenReturn(null);
         this.schemaContextHandler = new SchemaContextHandler(txHandler);
 
         this.schemaContext =
@@ -52,7 +52,7 @@ public class SchemaContextHandlerTest {
     }
 
     /**
-     * Testing init of {@link SchemaContextHandler}
+     * Testing init of {@link SchemaContextHandler}.
      */
     @Test
     public void schemaContextHandlerImplInitTest() {
@@ -61,6 +61,7 @@ public class SchemaContextHandlerTest {
 
     /**
      * Test getting actual {@link SchemaContext}.
+     *
      * <p>
      * Get <code>SchemaContext</code> from <code>SchemaContextHandler</code> and compare it to actual
      * <code>SchemaContext</code>.
@@ -73,6 +74,7 @@ public class SchemaContextHandlerTest {
 
     /**
      * Test updating of {@link SchemaContext}.
+     *
      * <p>
      * Create new <code>SchemaContext</code>, set it to <code>SchemaContextHandler</code> and check if
      * <code>SchemaContextHandler</code> reference to new <code>SchemaContext</code> instead of old one.