kop icon indicating copy to clipboard operation
kop copied to clipboard

[FEATURE] Support checking the KafkaRequestHandler in tests

Open BewareMyPower opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. Currently KoP doesn't support retrieving the active channels (i.e. KafkaRequestHandlers) in tests. It limits the test that it cannot check if the fields of the channel are expected. Currently KoP only supports creating a mocked KafkaRequestHandler whose ctx field is a mocked ChannelHandlerContext.

Describe the solution you'd like

A simple solution is to add a setChannelInitializers method to KafkaProtocolHandler to change the channelInitializerMap field.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Here is an ideal effect of checking KafkaRequestHandlers:

image

BewareMyPower avatar Jan 17 '22 09:01 BewareMyPower