Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
omkreddy committed Feb 12, 2021
1 parent cebb7c6 commit dc630df
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -740,18 +740,17 @@ public void shouldNotBeFlushedAfterFlush() {
@Test
public void testMetadataOnException() throws InterruptedException {
buildMockProducer(false);
Future<RecordMetadata> md1 = producer.send(record2, (md, exception) -> {
Future<RecordMetadata> metadata = producer.send(record2, (md, exception) -> {
assertNotNull(md);
assertEquals(md.offset(), -1L, "Invalid offset");
assertEquals(md.timestamp(), RecordBatch.NO_TIMESTAMP, "Invalid timestamp");
//assertEquals(md.checksum(), -1L, "Invalid checksum");
assertEquals(md.serializedKeySize(), -1L, "Invalid Serialized Key size");
assertEquals(md.serializedValueSize(), -1L, "Invalid Serialized value size");
});
IllegalArgumentException e = new IllegalArgumentException("dummy exception");
assertTrue(producer.errorNext(e), "Complete the second request with an error");
try {
md1.get();
metadata.get();
fail("Something went wrong, expected an error");
} catch (ExecutionException err) {
assertEquals(e, err.getCause());
Expand Down

0 comments on commit dc630df

Please sign in to comment.