Add testGetDuplicateHeaderMode()

This commit is contained in:
Gary Gregory 2022-10-21 08:59:14 -04:00
parent db16af9106
commit b4799e799a
1 changed files with 10 additions and 0 deletions

View File

@ -692,6 +692,16 @@ public class CSVFormatTest {
assertFalse(builder.setDuplicateHeaderMode(DuplicateHeaderMode.DISALLOW).build().getAllowDuplicateHeaderNames()); assertFalse(builder.setDuplicateHeaderMode(DuplicateHeaderMode.DISALLOW).build().getAllowDuplicateHeaderNames());
} }
@Test
public void testGetDuplicateHeaderMode() {
final Builder builder = CSVFormat.DEFAULT.builder();
assertEquals(DuplicateHeaderMode.ALLOW_ALL, builder.build().getDuplicateHeaderMode());
assertEquals(DuplicateHeaderMode.ALLOW_ALL, builder.setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_ALL).build().getDuplicateHeaderMode());
assertEquals(DuplicateHeaderMode.ALLOW_EMPTY, builder.setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_EMPTY).build().getDuplicateHeaderMode());
assertEquals(DuplicateHeaderMode.DISALLOW, builder.setDuplicateHeaderMode(DuplicateHeaderMode.DISALLOW).build().getDuplicateHeaderMode());
}
@Test @Test
public void testGetHeader() { public void testGetHeader() {
final String[] header = { "one", "two", "three" }; final String[] header = { "one", "two", "three" };