Fix resource leaks in test cases
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / test / java / org / opendaylight / controller / cluster / raft / behaviors / DelayedMessagesElectionScenarioTest.java
index 19dfe47..47bd459 100644 (file)
@@ -182,8 +182,7 @@ public class DelayedMessagesElectionScenarioTest extends AbstractLeaderElectionS
         DefaultConfigParamsImpl member2ConfigParams = newConfigParams();
         member2Context.setConfigParams(member2ConfigParams);
 
-        Follower member2Behavior = new Follower(member2Context);
-        member2Actor.behavior = member2Behavior;
+        member2Actor.behavior = new Follower(member2Context);
 
         // Create member 3's behavior initially as Follower
 
@@ -195,8 +194,7 @@ public class DelayedMessagesElectionScenarioTest extends AbstractLeaderElectionS
         DefaultConfigParamsImpl member3ConfigParams = newConfigParams();
         member3Context.setConfigParams(member3ConfigParams);
 
-        Follower member3Behavior = new Follower(member3Context);
-        member3Actor.behavior = member3Behavior;
+        member3Actor.behavior = new Follower(member3Context);
 
         // Create member 1's behavior initially as Leader
 
@@ -214,5 +212,6 @@ public class DelayedMessagesElectionScenarioTest extends AbstractLeaderElectionS
         member3Actor.clear();
 
         testLog.info("setupInitialMemberBehaviors ending");
+
     }
 }