Skip to content

Commit

Permalink
We should not honour duplicated context within a kafka interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Oct 4, 2024
1 parent 5737a69 commit 9bce37e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/test/java/io/vertx/kafka/client/tests/ProducerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,10 @@ public void testInterceptor(TestContext testCtx) throws Exception {
producer.exceptionHandler(testCtx::fail);
ProducerRecord<String, String> record = new ProducerRecord<>(topicName, 0, "key-0", "value-0");
ContextInternal ctx = (ContextInternal) vertx.getOrCreateContext();
ContextInternal dup = ctx.duplicate();
Async async = testCtx.async();
dup.runOnContext(v1 -> {
ctx.runOnContext(v1 -> {
TestInterceptor.list.clear();
producer.write(record).onComplete(testCtx.asyncAssertSuccess(v2 -> {
testCtx.assertEquals(1, TestInterceptor.list.size());
testCtx.assertEquals(dup, TestInterceptor.list.get(0));
async.complete();
}));
});
Expand Down

0 comments on commit 9bce37e

Please sign in to comment.