Fix checkstyle problems not detected by the current version
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / AbstractShardTest.java
index 8da5bf738718c24b45a575dd03b7e612c6b0de14..1c8686c1b1daac3b34d546fc3fe40b1cbdfe2f72 100644 (file)
@@ -55,7 +55,7 @@ import org.opendaylight.controller.cluster.datastore.modification.MergeModificat
 import org.opendaylight.controller.cluster.datastore.modification.MutableCompositeModification;
 import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
 import org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayload;
-import org.opendaylight.controller.cluster.datastore.persisted.PreBoronShardDataTreeSnapshot;
+import org.opendaylight.controller.cluster.datastore.persisted.MetadataShardDataTreeSnapshot;
 import org.opendaylight.controller.cluster.datastore.persisted.ShardSnapshotState;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.TestActorFactory;
@@ -125,7 +125,8 @@ public abstract class AbstractShardTest extends AbstractActorTest {
     }
 
     protected Shard.Builder newShardBuilder() {
-        return Shard.builder().id(shardID).datastoreContext(newDatastoreContext()).schemaContext(SCHEMA_CONTEXT);
+        return Shard.builder().id(shardID).datastoreContext(newDatastoreContext())
+            .schemaContextProvider(() -> SCHEMA_CONTEXT);
     }
 
     protected void testRecovery(final Set<Integer> listEntryKeys) throws Exception {
@@ -206,9 +207,8 @@ public abstract class AbstractShardTest extends AbstractActorTest {
             return null;
         }).when(mock).validate(any(DataTreeModification.class));
 
-        doAnswer(invocation -> {
-            return actual.prepare(invocation.getArgumentAt(0, DataTreeModification.class));
-        }).when(mock).prepare(any(DataTreeModification.class));
+        doAnswer(invocation -> actual.prepare(invocation.getArgumentAt(0, DataTreeModification.class))).when(
+                mock).prepare(any(DataTreeModification.class));
 
         doAnswer(invocation -> {
             actual.commit(invocation.getArgumentAt(0, DataTreeCandidate.class));
@@ -220,13 +220,9 @@ public abstract class AbstractShardTest extends AbstractActorTest {
             return null;
         }).when(mock).setSchemaContext(any(SchemaContext.class));
 
-        doAnswer(invocation -> {
-            return actual.takeSnapshot();
-        }).when(mock).takeSnapshot();
+        doAnswer(invocation -> actual.takeSnapshot()).when(mock).takeSnapshot();
 
-        doAnswer(invocation -> {
-            return actual.getRootPath();
-        }).when(mock).getRootPath();
+        doAnswer(invocation -> actual.getRootPath()).when(mock).getRootPath();
 
         return mock;
     }
@@ -350,7 +346,7 @@ public abstract class AbstractShardTest extends AbstractActorTest {
         final NormalizedNode<?, ?> root = readStore(testStore, YangInstanceIdentifier.EMPTY);
 
         InMemorySnapshotStore.addSnapshot(shardID.toString(), Snapshot.create(
-                new ShardSnapshotState(new PreBoronShardDataTreeSnapshot(root)),
+                new ShardSnapshotState(new MetadataShardDataTreeSnapshot(root)),
                 Collections.<ReplicatedLogEntry>emptyList(), 0, 1, -1, -1, 1, null, null));
         return testStore;
     }
@@ -490,7 +486,7 @@ public abstract class AbstractShardTest extends AbstractActorTest {
         }
 
         @SuppressWarnings("unchecked")
-        private <T> FutureCallback<T> mockFutureCallback(final FutureCallback<T> actual) {
+        private static <T> FutureCallback<T> mockFutureCallback(final FutureCallback<T> actual) {
             FutureCallback<T> mock = mock(FutureCallback.class);
             doAnswer(invocation -> {
                 actual.onFailure(invocation.getArgumentAt(0, Throwable.class));