mirror of
https://github.com/apache/nifi.git
synced 2025-02-06 01:58:32 +00:00
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:
parent
2609fd5f55
commit
6877e84931
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user