From b86f90a69b6a824c9b514e04254370ab39ab58dc Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 23 Mar 2017 11:50:01 -0400 Subject: [PATCH] Stop more initiators in LeaderInitiatorTests JIRA: https://jira.spring.io/browse/INT-4246 **Cherry-pick to master** --- .../support/leader/LockRegistryLeaderInitiatorTests.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java index 00d6f8137a..db2565f2de 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java @@ -29,9 +29,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.Lock; -import org.apache.log4j.Level; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.springframework.integration.leader.Context; @@ -39,7 +37,6 @@ import org.springframework.integration.leader.DefaultCandidate; import org.springframework.integration.leader.event.LeaderEventPublisher; import org.springframework.integration.support.locks.DefaultLockRegistry; import org.springframework.integration.support.locks.LockRegistry; -import org.springframework.integration.test.rule.Log4jLevelAdjuster; /** * @author Dave Syer @@ -50,9 +47,6 @@ import org.springframework.integration.test.rule.Log4jLevelAdjuster; */ public class LockRegistryLeaderInitiatorTests { - @Rule - public Log4jLevelAdjuster adjuster = new Log4jLevelAdjuster(Level.TRACE, "org.springframework.integration"); - private CountDownLatch granted; private CountDownLatch revoked; @@ -92,6 +86,7 @@ public class LockRegistryLeaderInitiatorTests { assertThat(this.initiator.getContext().isLeader(), is(true)); this.initiator.getContext().yield(); assertThat(this.revoked.await(10, TimeUnit.SECONDS), is(true)); + this.initiator.stop(); } @Test @@ -106,6 +101,7 @@ public class LockRegistryLeaderInitiatorTests { this.initiator.stop(); assertThat(other.await(10, TimeUnit.SECONDS), is(true)); assertThat(another.getContext().isLeader(), is(true)); + another.stop(); } @Test