diff --git a/src/test/java/org/apache/commons/csv/CSVRecordTest.java b/src/test/java/org/apache/commons/csv/CSVRecordTest.java index 06e771c4..97bb6fce 100644 --- a/src/test/java/org/apache/commons/csv/CSVRecordTest.java +++ b/src/test/java/org/apache/commons/csv/CSVRecordTest.java @@ -41,9 +41,9 @@ public class CSVRecordTest { UNKNOWN_COLUMN } - private String[] values; - private CSVRecord record, recordWithHeader; private Map headerMap; + private CSVRecord record, recordWithHeader; + private String[] values; @BeforeEach public void setUp() throws Exception { @@ -133,13 +133,6 @@ public class CSVRecordTest { assertFalse(recordWithHeader.isMapped("fourth")); } - @Test - public void testIsSetString() { - assertFalse(record.isSet("first")); - assertTrue(recordWithHeader.isSet("first")); - assertFalse(recordWithHeader.isSet("fourth")); - } - @Test public void testIsSetInt() { assertFalse(record.isSet(-1)); @@ -150,6 +143,13 @@ public class CSVRecordTest { assertFalse(recordWithHeader.isSet(1000)); } + @Test + public void testIsSetString() { + assertFalse(record.isSet("first")); + assertTrue(recordWithHeader.isSet("first")); + assertFalse(recordWithHeader.isSet("fourth")); + } + @Test public void testIterator() { int i = 0; @@ -190,14 +190,6 @@ public class CSVRecordTest { this.validateMap(map, true); } - @Test - public void testToMapWithShortRecord() throws Exception { - try (final CSVParser parser = CSVParser.parse("a,b", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) { - final CSVRecord shortRec = parser.iterator().next(); - shortRec.toMap(); - } - } - @Test public void testToMapWithNoHeader() throws Exception { try (final CSVParser parser = CSVParser.parse("a,b", CSVFormat.newFormat(','))) { @@ -208,6 +200,14 @@ public class CSVRecordTest { } } + @Test + public void testToMapWithShortRecord() throws Exception { + try (final CSVParser parser = CSVParser.parse("a,b", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) { + final CSVRecord shortRec = parser.iterator().next(); + shortRec.toMap(); + } + } + private void validateMap(final Map map, final boolean allowsNulls) { assertTrue(map.containsKey("first")); assertTrue(map.containsKey("second"));