File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed
metrics/src/test/java/com/google/cloud/opentelemetry/metric
trace/src/test/java/com/google/cloud/opentelemetry/trace Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ subprojects {
165165 openTelemetryContribVersion = ' 1.39.0'
166166 junitVersion = ' 4.13'
167167 junit5Version = ' 5.10.0'
168- mockitoVersion = ' 3.5.10 '
168+ mockitoVersion = ' 5.2.0 '
169169 pubSubVersion = ' 1.133.0'
170170 testContainersVersion = ' 1.15.1'
171171 wiremockVersion = ' 2.35.0'
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ public void testCreateWithMetricServiceSettingExportSucceeds() throws IOExceptio
171171 // verify that the MetricServiceClient used in the exporter was created using the
172172 // MetricServiceSettings provided in configuration
173173 mockedServiceClientClass .verify (
174- times ( 1 ), () -> MetricServiceClient .create (eq (configuration .getMetricServiceSettings ())));
174+ () -> MetricServiceClient .create (eq (configuration .getMetricServiceSettings ())), times ( 1 ));
175175
176176 // verify that export operation on the resulting exporter can still be called
177177 CompletableResultCode result = exporter .export (ImmutableList .of (aMetricData , aHistogram ));
@@ -816,9 +816,9 @@ public void verifyExporterWorksWithDefaultConfiguration() {
816816 simulateExport (metricExporter );
817817
818818 mockedMetricServiceClient .verify (
819- Mockito .times ( 1 ),
820- () -> MetricServiceClient . create (( MetricServiceSettings ) Mockito .any () ));
821- mockedServiceOptions .verify (Mockito .times (1 ), ServiceOptions :: getDefaultProjectId );
819+ () -> MetricServiceClient . create (( MetricServiceSettings ) Mockito .any () ),
820+ Mockito .times ( 1 ));
821+ mockedServiceOptions .verify (ServiceOptions :: getDefaultProjectId , Mockito .times (1 ));
822822 Mockito .verify (this .mockMetricServiceClient )
823823 .createTimeSeries ((ProjectName ) Mockito .any (), Mockito .anyList ());
824824 } finally {
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ public void testConfigurationWithDefaultProjectIdSucceeds() {
107107
108108 MetricConfiguration configuration = MetricConfiguration .builder ().build ();
109109 assertEquals (PROJECT_ID , configuration .getProjectId ());
110- serviceOptionsMockedStatic .verify (Mockito .times (1 ), ServiceOptions :: getDefaultProjectId );
110+ serviceOptionsMockedStatic .verify (ServiceOptions :: getDefaultProjectId , Mockito .times (1 ));
111111 }
112112 }
113113
@@ -127,7 +127,7 @@ public void verifyCallToDefaultProjectIdIsMemoized() {
127127 metricConfiguration2 .getProjectId ();
128128
129129 // ServiceOptions#getDefaultProjectId should only be called once per TraceConfiguration object
130- serviceOptionsMockedStatic .verify (Mockito .times (2 ), ServiceOptions :: getDefaultProjectId );
130+ serviceOptionsMockedStatic .verify (ServiceOptions :: getDefaultProjectId , Mockito .times (2 ));
131131 }
132132 }
133133}
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public void allowToUseDefaultProjectId() {
9898 TraceConfiguration traceConfiguration = TraceConfiguration .builder ().build ();
9999 assertEquals (PROJECT_ID , traceConfiguration .getProjectId ());
100100
101- mockedServiceOptions .verify (Mockito .times (1 ), ServiceOptions :: getDefaultProjectId );
101+ mockedServiceOptions .verify (ServiceOptions :: getDefaultProjectId , Mockito .times (1 ));
102102 }
103103 }
104104
@@ -164,7 +164,7 @@ public void verifyCallToDefaultProjectIdIsMemoize() {
164164 traceConfiguration2 .getProjectId ();
165165
166166 // ServiceOptions#getDefaultProjectId should only be called once per TraceConfiguration object
167- serviceOptionsMockedStatic .verify (Mockito .times (2 ), ServiceOptions :: getDefaultProjectId );
167+ serviceOptionsMockedStatic .verify (ServiceOptions :: getDefaultProjectId , Mockito .times (2 ));
168168 }
169169 }
170170}
Original file line number Diff line number Diff line change @@ -101,8 +101,8 @@ public void verifyExporterWorksWithDefaultConfiguration() {
101101 simulateExport (exporter );
102102
103103 mockedTraceServiceClient .verify (
104- Mockito . times ( 1 ), () -> TraceServiceClient .create ((TraceServiceSettings ) Mockito .any ()));
105- mockedServiceOptions .verify (Mockito .times (1 ), ServiceOptions :: getDefaultProjectId );
104+ () -> TraceServiceClient .create ((TraceServiceSettings ) Mockito .any ()), Mockito . times ( 1 ));
105+ mockedServiceOptions .verify (ServiceOptions :: getDefaultProjectId , Mockito .times (1 ));
106106 Mockito .verify (this .mockedTraceServiceClient )
107107 .batchWriteSpans ((ProjectName ) Mockito .any (), Mockito .anyList ());
108108 }
You can’t perform that action at this time.
0 commit comments