This repository was archived by the owner on Jun 3, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545import java .util .Arrays ;
4646import java .util .Objects ;
4747
48+ import org .apache .commons .csv .CSVFormat .Builder ;
4849import org .junit .jupiter .api .Assertions ;
4950import org .junit .jupiter .api .Test ;
5051
@@ -1168,6 +1169,15 @@ public void testWithEmptyDuplicates() {
11681169 assertFalse (formatWithEmptyDuplicates .getAllowDuplicateHeaderNames ());
11691170 }
11701171
1172+ @ Test
1173+ public void testGetAllowDuplicateHeaderNames () {
1174+ final Builder builder = CSVFormat .DEFAULT .builder ();
1175+ assertTrue (builder .build ().getAllowDuplicateHeaderNames ());
1176+ assertTrue (builder .setDuplicateHeaderMode (DuplicateHeaderMode .ALLOW_ALL ).build ().getAllowDuplicateHeaderNames ());
1177+ assertFalse (builder .setDuplicateHeaderMode (DuplicateHeaderMode .ALLOW_EMPTY ).build ().getAllowDuplicateHeaderNames ());
1178+ assertFalse (builder .setDuplicateHeaderMode (DuplicateHeaderMode .DISALLOW ).build ().getAllowDuplicateHeaderNames ());
1179+ }
1180+
11711181 @ Test
11721182 public void testWithEmptyEnum () {
11731183 final CSVFormat formatWithHeader = CSVFormat .DEFAULT .withHeader (EmptyEnum .class );
You can’t perform that action at this time.
0 commit comments