Skip to content

Commit 984d3b3

Browse files
committed
Updated AssertFile to use Jupiter package names
resolves #4111
1 parent f104baa commit 984d3b3

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

spring-batch-samples/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@
175175
<artifactId>junit-jupiter-engine</artifactId>
176176
<version>${junit-jupiter.version}</version>
177177
</dependency>
178+
<dependency>
179+
<groupId>org.junit.jupiter</groupId>
180+
<artifactId>junit-jupiter-api</artifactId>
181+
<version>${junit-jupiter.version}</version>
182+
<optional>true</optional>
183+
</dependency>
178184
<dependency>
179185
<groupId>org.hamcrest</groupId>
180186
<artifactId>hamcrest-library</artifactId>

spring-batch-test/src/main/java/org/springframework/batch/test/AssertFile.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2007 the original author or authors.
2+
* Copyright 2006-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.batch.test;
1818

19-
import static org.junit.Assert.assertEquals;
19+
import static org.junit.jupiter.api.Assertions.assertEquals;
2020

2121
import java.io.BufferedReader;
2222
import java.io.File;
@@ -28,6 +28,7 @@
2828
* This class can be used to assert that two files are the same.
2929
*
3030
* @author Dan Garrette
31+
* @author Glenn Renfro
3132
* @since 2.0
3233
*/
3334
public abstract class AssertFile {
@@ -39,12 +40,12 @@ public static void assertFileEquals(File expected, File actual) throws Exception
3940
int lineNum = 1;
4041
for (String expectedLine = null; (expectedLine = expectedReader.readLine()) != null; lineNum++) {
4142
String actualLine = actualReader.readLine();
42-
assertEquals("Line number " + lineNum + " does not match.", expectedLine, actualLine);
43+
assertEquals(expectedLine, actualLine, "Line number " + lineNum + " does not match.");
4344
}
4445

4546
String actualLine = actualReader.readLine();
46-
assertEquals("More lines than expected. There should not be a line number " + lineNum + ".", null,
47-
actualLine);
47+
assertEquals(null, actualLine,
48+
"More lines than expected. There should not be a line number " + lineNum + ".");
4849
}
4950
finally {
5051
expectedReader.close();

0 commit comments

Comments
 (0)