Bump upstreams
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / IntegrationTestKit.java
index 72cfdceeeaff415dd86d189bef84dae0b33ed207..f95c6eb4f4b0ac6fee03e18b8b114e4d769c62bc 100644 (file)
@@ -77,12 +77,14 @@ public class IntegrationTestKit extends ShardTestKit {
         return datastoreContextBuilder;
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStore(final String typeName, final String moduleShardsConfig,
                                                           final boolean waitUntilLeader,
                                                           final EffectiveModelContext schemaContext) throws Exception {
         return setupDistributedDataStore(typeName, moduleShardsConfig, "modules.conf", waitUntilLeader, schemaContext);
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStore(final String typeName, final String moduleShardsConfig,
                                                           final String modulesConfig,
                                                           final boolean waitUntilLeader,
@@ -169,6 +171,7 @@ public class IntegrationTestKit extends ShardTestKit {
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName,
                                                                        final EffectiveModelContext schemaContext) {
         final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
@@ -191,6 +194,7 @@ public class IntegrationTestKit extends ShardTestKit {
         return dataStore;
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName,
                                                                        final EffectiveModelContext schemaContext,
                                                                        final LogicalDatastoreType storeType) {
@@ -253,15 +257,14 @@ public class IntegrationTestKit extends ShardTestKit {
     }
 
     public static ActorRef findLocalShard(final ActorUtils actorUtils, final String shardName) {
-        ActorRef shard = null;
-        for (int i = 0; i < 20 * 5 && shard == null; i++) {
+        for (int i = 0; i < 20 * 5; i++) {
             Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
             Optional<ActorRef> shardReply = actorUtils.findLocalShard(shardName);
             if (shardReply.isPresent()) {
-                shard = shardReply.get();
+                return shardReply.orElseThrow();
             }
         }
-        return shard;
+        return null;
     }
 
     public static void waitUntilShardIsDown(final ActorUtils actorUtils, final String shardName) {