clintropolis commented on a change in pull request #10929:
URL: https://github.com/apache/druid/pull/10929#discussion_r588776719
##########
File path:
extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/avro/SchemaRegistryBasedAvroBytesDecoderTest.java
##########
@@ -109,27 +112,50 @@ public void testParse() throws Exception
}
@Test(expected = ParseException.class)
- public void testParseCorrupted() throws Exception
+ public void testParseCorruptedNotEnoughBytesToEvenGetSchemaInfo()
{
// Given
-
Mockito.when(registry.getSchemaById(ArgumentMatchers.eq(1234))).thenReturn(new
AvroSchema(SomeAvroDatum.getClassSchema()));
+ ByteBuffer bb = ByteBuffer.allocate(2).put((byte) 0).put(1, (byte) 1);
+ bb.rewind();
+ // When
+ GenericRecord record = new
SchemaRegistryBasedAvroBytesDecoder(registry).parse(bb);
+ Assert.assertNull(record);
Review comment:
deleted this and other similar lines that would never be reached
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]