RocMarshal commented on code in PR #20715: URL: https://github.com/apache/flink/pull/20715#discussion_r962088033
########## flink-java/src/test/java/org/apache/flink/api/java/io/CSVReaderTest.java: ########## @@ -40,258 +40,262 @@ import org.apache.flink.types.StringValue; import org.apache.flink.types.Value; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.Arrays; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.fail; /** Tests for the CSV reader builder. */ -public class CSVReaderTest { +class CSVReaderTest { @Test - public void testIgnoreHeaderConfigure() { + void testIgnoreHeaderConfigure() { CsvReader reader = getCsvReader(); reader.ignoreFirstLine(); - Assert.assertTrue(reader.skipFirstLineAsHeader); + assertThat(reader.skipFirstLineAsHeader).isTrue(); } @Test - public void testIgnoreInvalidLinesConfigure() { + void testIgnoreInvalidLinesConfigure() { CsvReader reader = getCsvReader(); - Assert.assertFalse(reader.ignoreInvalidLines); + assertThat(reader.ignoreInvalidLines).isFalse(); reader.ignoreInvalidLines(); - Assert.assertTrue(reader.ignoreInvalidLines); + assertThat(reader.ignoreInvalidLines).isTrue(); } @Test - public void testIgnoreComments() { + void testIgnoreComments() { CsvReader reader = getCsvReader(); - assertNull(reader.commentPrefix); + assertThat(reader.commentPrefix).isNull(); reader.ignoreComments("#"); - assertEquals("#", reader.commentPrefix); + assertThat(reader.commentPrefix).isEqualTo("#"); } @Test - public void testCharset() { + void testCharset() { CsvReader reader = getCsvReader(); - assertEquals("UTF-8", reader.getCharset()); + assertThat(reader.getCharset()).isEqualTo("UTF-8"); reader.setCharset("US-ASCII"); - assertEquals("US-ASCII", reader.getCharset()); + assertThat(reader.getCharset()).isEqualTo("US-ASCII"); } @Test - public void testIncludeFieldsDense() { + void testIncludeFieldsDense() { CsvReader reader = getCsvReader(); reader.includeFields(true, true, true); - Assert.assertTrue(Arrays.equals(new boolean[] {true, true, true}, reader.includedMask)); + assertThat(Arrays.equals(new boolean[] {true, true, true}, reader.includedMask)).isTrue(); Review Comment: Good catch! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org