NIFI-11135 Upgraded Commons CSV from 1.9.0 to 1.10.0

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #6921.
This commit is contained in:
exceptionfactory 2023-02-02 15:58:07 -06:00 committed by Pierre Villard
parent 2609fd5f55
commit 6877e84931
No known key found for this signature in database
GPG Key ID: F92A93B30C07C6D5
4 changed files with 6 additions and 13 deletions

View File

@ -54,7 +54,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.9.0</version>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>

View File

@ -59,7 +59,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.9.0</version>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>

View File

@ -64,7 +64,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.9.0</version>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>

View File

@ -50,6 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class TestCSVRecordReader {
private final DataType doubleDataType = RecordFieldType.DOUBLE.getDataType();
@ -826,11 +827,7 @@ public class TestCSVRecordReader {
final CSVFormat disallowDuplicateHeadersFormat = CSVFormat.DEFAULT.withFirstRecordAsHeader().withTrim().withQuote('"').withAllowDuplicateHeaderNames(false);
try (final InputStream bais = new ByteArrayInputStream(inputData)) {
final IllegalArgumentException iae = assertThrows(IllegalArgumentException.class, () -> createReader(bais, schema, disallowDuplicateHeadersFormat));
assertEquals(
"The header contains a duplicate name: \"id\" in [id, id, name, name, balance, BALANCE, address, city, state, zipCode, country]. " +
"If this is valid then use CSVFormat.withAllowDuplicateHeaderNames().",
iae.getMessage()
);
assertTrue(iae.getMessage().startsWith("The header contains a duplicate name"));
}
}
@ -870,11 +867,7 @@ public class TestCSVRecordReader {
final CSVFormat disallowDuplicateHeadersFormat = CSVFormat.RFC4180.withTrim().withAllowDuplicateHeaderNames(false);
try (final InputStream bais = new ByteArrayInputStream(inputData)) {
final IllegalArgumentException iae = assertThrows(IllegalArgumentException.class, () -> createReader(bais, schema, disallowDuplicateHeadersFormat, false));
assertEquals(
"The header contains a duplicate name: \"id\" in [id, id, name, name, balance, BALANCE, address, city, state, zipCode, country]. " +
"If this is valid then use CSVFormat.withAllowDuplicateHeaderNames().",
iae.getMessage()
);
assertTrue(iae.getMessage().startsWith("The header contains a duplicate name"));
}
}