Update tests now that BulkLoadValueMapper removes non-valid possible-value values from record.

This commit is contained in:
2025-01-29 11:34:56 -06:00
parent 0635a9128c
commit d14662e2fc
2 changed files with 8 additions and 5 deletions

View File

@ -149,10 +149,13 @@ class BulkLoadValueMapperTest extends BaseTest
testPossibleValue("IL", 1, false);
testPossibleValue("il", 1, false);
testPossibleValue(512, 512, true); // an id, but not in the PVS
testPossibleValue("USA", "USA", true);
testPossibleValue(true, true, true);
testPossibleValue(new BigDecimal("4.7"), new BigDecimal("4.7"), true);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// unmappables - should have a null value (this used to not be the case - the bad-value would come through...) //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
testPossibleValue(512, null, true); // an int, but not in the PVS
testPossibleValue("USA", null, true);
testPossibleValue(true, null, true);
testPossibleValue(new BigDecimal("4.7"), null, true);
}

View File

@ -240,7 +240,7 @@ class FlatRowsToRecordTest extends BaseTest
List<QRecord> records = rowsToRecord.nextPage(fileToRows, header, mapping, Integer.MAX_VALUE);
assertEquals(5, records.size());
assertEquals(List.of("Homer", "Marge", "Bart", "Ned", "Mr."), getValues(records, "firstName"));
assertEquals(ListBuilder.of(1, 2, null, "Not a state", 5), getValues(records, "homeStateId"));
assertEquals(ListBuilder.of(1, 2, null, null, null), getValues(records, "homeStateId"));
assertThat(records.get(0).getErrors()).isNullOrEmpty();
assertThat(records.get(1).getErrors()).isNullOrEmpty();