diff --git a/build.gradle b/build.gradle index c1316dc0a1..081d77f557 100644 --- a/build.gradle +++ b/build.gradle @@ -136,7 +136,7 @@ subprojects { subproject -> springSecurityVersion = '4.1.4.RELEASE' springSocialTwitterVersion = '1.1.2.RELEASE' springRetryVersion = '1.1.3.RELEASE' - springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.3.9.RELEASE' + springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.3.10.RELEASE' springWsVersion = '2.3.0.RELEASE' xmlUnitVersion = '1.6' xstreamVersion = '1.4.7' diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/leader/JdbcLockRegistryLeaderInitiatorTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/leader/JdbcLockRegistryLeaderInitiatorTests.java index b4c5b02381..d854ad8b67 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/leader/JdbcLockRegistryLeaderInitiatorTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/leader/JdbcLockRegistryLeaderInitiatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,7 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; /** * @author Artem Bilan * @author Gary Russell + * * @since 4.3.1 */ public class JdbcLockRegistryLeaderInitiatorTests { @@ -155,15 +156,16 @@ public class JdbcLockRegistryLeaderInitiatorTests { assertThat(initiator1.getContext().isLeader(), is(true)); assertThat(initiator2.getContext().isLeader(), is(false)); + // Stop second initiator, so the first one will be leader even after yield initiator2.stop(); - CountDownLatch revoked11 = new CountDownLatch(1); - initiator1.setLeaderEventPublisher(new CountingPublisher(new CountDownLatch(1), revoked11)); + CountDownLatch granted11 = new CountDownLatch(1); + initiator1.setLeaderEventPublisher(new CountingPublisher(granted11)); initiator1.getContext().yield(); - assertThat(revoked11.await(10, TimeUnit.SECONDS), is(true)); - assertThat(initiator1.getContext().isLeader(), is(false)); + assertThat(granted11.await(20, TimeUnit.SECONDS), is(true)); + assertThat(initiator1.getContext().isLeader(), is(true)); initiator1.stop(); }