This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new f96e07ef3 Use better JUnit API
f96e07ef3 is described below
commit f96e07ef33ad433246e997dcdd23e5ae41f51579
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Mar 22 16:35:33 2024 -0400
Use better JUnit API
---
src/test/java/org/apache/commons/io/CharsetsTest.java | 5 +++--
src/test/java/org/apache/commons/io/filefilter/FileFilterTest.java | 3 ++-
src/test/java/org/apache/commons/io/function/IOStreamTest.java | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/test/java/org/apache/commons/io/CharsetsTest.java
b/src/test/java/org/apache/commons/io/CharsetsTest.java
index b18545289..8594011da 100644
--- a/src/test/java/org/apache/commons/io/CharsetsTest.java
+++ b/src/test/java/org/apache/commons/io/CharsetsTest.java
@@ -18,6 +18,7 @@
package org.apache.commons.io;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
@@ -87,10 +88,10 @@ public class CharsetsTest {
@Test
public void testToCharset_String_Charset() {
- assertEquals(null, Charsets.toCharset((String) null, null));
+ assertNull(Charsets.toCharset((String) null, null));
assertEquals(Charset.defaultCharset(), Charsets.toCharset((String)
null, Charset.defaultCharset()));
assertEquals(Charset.defaultCharset(), Charsets.toCharset((Charset)
null, Charset.defaultCharset()));
- assertEquals(null, Charsets.toCharset((Charset) null, null));
+ assertNull(Charsets.toCharset((Charset) null, null));
assertEquals(Charset.defaultCharset(),
Charsets.toCharset(Charset.defaultCharset(), Charset.defaultCharset()));
assertEquals(StandardCharsets.UTF_8,
Charsets.toCharset(StandardCharsets.UTF_8, Charset.defaultCharset()));
assertEquals(StandardCharsets.UTF_8,
Charsets.toCharset(StandardCharsets.UTF_8, null));
diff --git a/src/test/java/org/apache/commons/io/filefilter/FileFilterTest.java
b/src/test/java/org/apache/commons/io/filefilter/FileFilterTest.java
index cd679db6f..155ac1f6b 100644
--- a/src/test/java/org/apache/commons/io/filefilter/FileFilterTest.java
+++ b/src/test/java/org/apache/commons/io/filefilter/FileFilterTest.java
@@ -52,6 +52,7 @@ import org.apache.commons.io.file.TempFile;
import org.apache.commons.io.test.TestUtils;
import org.apache.commons.lang3.SystemUtils;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Used to test FileFilterUtils.
@@ -650,7 +651,7 @@ public class FileFilterTest extends AbstractFilterTest {
final IOFileFilter filter = FileFilterUtils.trueFileFilter();
List<File> filteredList = FileFilterUtils.filterList(filter,
Collections.singletonList(null));
assertEquals(1, filteredList.size());
- assertEquals(null, filteredList.get(0));
+ assertNull(filteredList.get(0));
filteredList = FileFilterUtils.filterList(filter, (List<File>) null);
assertEquals(0, filteredList.size());
diff --git a/src/test/java/org/apache/commons/io/function/IOStreamTest.java
b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
index 08f7e4459..71f5182e5 100644
--- a/src/test/java/org/apache/commons/io/function/IOStreamTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
@@ -462,7 +462,7 @@ public class IOStreamTest {
if (AT_LEAST_JAVA_11) {
assertEquals(1, IOStream.of("B").peek(e -> compareAndSetRE(ref,
null, e)).count());
assertEquals(1, IOStream.of("B").peek(e -> compareAndSetIO(ref,
null, e)).count());
- assertEquals(null, ref.get());
+ assertNull(ref.get());
} else {
// Java 8
assertThrows(RuntimeException.class, () -> IOStream.of("B").peek(e
-> compareAndSetRE(ref, null, e)).count());