Skip to content

Commit 9223826

Browse files
hpoettkerfmbenhassine
authored andcommitted
Fix JdbcJobExecutionDaoTests
1 parent 1498f90 commit 9223826

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobExecutionDaoTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import static org.junit.jupiter.api.Assertions.assertTrue;
4242

4343
/**
44-
* Parent Test Class for {@link JdbcJobExecutionDao} and {@link MapJobExecutionDao}.
44+
* Parent Test Class for {@link JdbcJobExecutionDao}.
4545
*/
4646
public abstract class AbstractJobExecutionDaoTests {
4747

@@ -241,8 +241,9 @@ void testFindRunningExecutions() {
241241
Set<JobExecution> values = dao.findRunningJobExecutions(exec.getJobInstance().getJobName());
242242

243243
assertEquals(3, values.size());
244-
JobExecution value = values.iterator().next();
245-
assertEquals(exec, value);
244+
Long jobExecutionId = exec.getId();
245+
JobExecution value = values.stream().filter(jobExecution -> jobExecutionId.equals(jobExecution.getId()))
246+
.findFirst().orElseThrow();
246247
assertEquals(now.plus(3, ChronoUnit.SECONDS), value.getLastUpdated());
247248

248249
}

0 commit comments

Comments
 (0)