Skip to content

Commit b1aa186

Browse files
committed
Fix two tests
Whitelist test should allow only one value (fulllName = Test) Json serialization correctly serialize the value fullName as "Test"
1 parent 12cc06c commit b1aa186

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/java/com/github/dariobalinzo/task/ElasticSourceTaskTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ public void shouldRunSourceTaskWhitelist() throws IOException, InterruptedExcept
392392
//when (fetching first page)
393393
task.start(conf);
394394
List<SourceRecord> poll1 = task.poll();
395+
//Check the struct contains one only field, and this is "FullName" = "Test"
396+
assertEquals(1, ((Struct) poll1.get(0).value()).schema().fields().size());
395397
assertEquals(((Struct) poll1.get(0).value()).get("fullName"), "Test");
396398
task.stop();
397399
}
@@ -417,6 +419,7 @@ public void shouldRunSourceTaskWithJsonCastFilter() throws IOException, Interrup
417419
task.start(conf);
418420
List<SourceRecord> poll1 = task.poll();
419421
Struct structValue = (Struct) poll1.get(0).value();
422+
assertEquals(structValue.get("fullName"), "\"Test\"");
420423
assertEquals(structValue.get("avroField"), "avro-field");
421424
assertEquals(structValue.get("nonavrofield"), "non-avro-field");
422425
task.stop();

0 commit comments

Comments
 (0)