File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
xds/src/test/java/io/grpc/xds Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1717package io .grpc .xds ;
1818
1919import static com .google .common .truth .Truth .assertThat ;
20+ import static org .mockito .AdditionalAnswers .delegatesTo ;
2021import static org .mockito .ArgumentMatchers .any ;
2122import static org .mockito .ArgumentMatchers .argThat ;
2223import static org .mockito .ArgumentMatchers .eq ;
@@ -82,14 +83,14 @@ public class XdsClientMetricReporterImplTest {
8283 @ Rule
8384 public final MockitoRule mocks = MockitoJUnit .rule ();
8485
85- @ Mock
86- private MetricRecorder mockMetricRecorder ;
8786 @ Mock
8887 private XdsClient mockXdsClient ;
89- @ Mock
90- private BatchRecorder mockBatchRecorder ;
9188 @ Captor
9289 private ArgumentCaptor <BatchCallback > gaugeBatchCallbackCaptor ;
90+ private MetricRecorder mockMetricRecorder = mock (MetricRecorder .class ,
91+ delegatesTo (new MetricRecorderImpl ()));
92+ private BatchRecorder mockBatchRecorder = mock (BatchRecorder .class ,
93+ delegatesTo (new BatchRecorderImpl ()));
9394
9495 private XdsClientMetricReporterImpl reporter ;
9596
@@ -372,6 +373,12 @@ public boolean matches(T instrument) {
372373 });
373374 }
374375
376+ static class MetricRecorderImpl implements MetricRecorder {
377+ }
378+
379+ static class BatchRecorderImpl implements BatchRecorder {
380+ }
381+
375382 static class TestlogHandler extends Handler {
376383 List <LogRecord > logs = new ArrayList <>();
377384
You can’t perform that action at this time.
0 commit comments