[ 
https://issues.apache.org/jira/browse/KAFKA-5676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17350960#comment-17350960
 ] 

Bruno Cadonna edited comment on KAFKA-5676 at 5/25/21, 10:42 AM:
-----------------------------------------------------------------

[~marcolotz] Thank you for looking into this!
The classes that use {{StreamsMetricsImpl}} should be only internal classes, 
like {{ClientMetrics}} that contains {{addStateMetrics()}}. They are allowed to 
use the implementation instead of the interface. The interface 
{{StreamsMetrics}} should be the one that is exposed in the public API.
Currently, I do not recall why we need to move {{MockStreamsMetrics}} in the 
public API. 
IMO, we should get rid of {{MockStreamsMetrics}} and replace its usages with an 
EasyMock mock. However, I do not know whether this is straight forward.
See also KAFKA-8977.



was (Author: cadonna):
[~marcolotz] Thank you for looking into this!
The classes that use {{StreamsMetricsImpl}} should be only internal classes, 
like {{ClientMetrics}} that contains {{addStateMetrics()}}. They are allowed to 
use the implementation instead of the interface. The interface 
{{StreamsMetrics}} should be the one that is exposed in the public API.
Currently, I do not recall why we need to move {{MockStreamsMetrics}} in the 
public API. 
IMO, we should get rid of {{MockStreamsMetrics}} and replace its usages with an 
EasyMock mock. However, I do not know whether this is straight forward.


> MockStreamsMetrics should be in o.a.k.test
> ------------------------------------------
>
>                 Key: KAFKA-5676
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5676
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Guozhang Wang
>            Assignee: Marco Lotz
>            Priority: Major
>              Labels: newbie
>          Time Spent: 96h
>  Remaining Estimate: 0h
>
> {{MockStreamsMetrics}}'s package should be `o.a.k.test` not 
> `o.a.k.streams.processor.internals`. 
> In addition, it should not require a {{Metrics}} parameter in its constructor 
> as it is only needed for its extended base class; the right way of mocking 
> should be implementing {{StreamsMetrics}} with mock behavior than extended a 
> real implementaion of {{StreamsMetricsImpl}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to