Skip to content

Introduce @KafkaListenerTest for focused Kafka Listener testing #45706

@gustavomonarin

Description

@gustavomonarin

Currently, testing Kafka listeners typically involves @SpringBootTest and @EmbeddedKafka, which loads the entire application context (as documented here).

To enable more lightweight and focused testing of Kafka listeners, similar to how @WebMvcTest allows for testing web controllers in isolation, could anew new test slice be introduced? @KafkaListenerTest.

This slice would focus on testing a specific listener and its associated configuration (e.g., serialization/deserialization, error handlers) without the overhead of the full application context.

This could significantly improve the efficiency and speed of testing Kafka listener components.

Any thoughts on this proposal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions