mirror of
https://github.com/google/nomulus
synced 2026-09-18 22:14:23 +00:00
Refactor EppMetrics into the EppMetric value type
This change refactors EppMetrics from the mutable self-exporting thing that it was into a real value type EppMetric, and delegates exporting functionality to the BigQueryMetricsEnqueuer. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132387660
This commit is contained in:
@@ -35,7 +35,7 @@ import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
import google.registry.monitoring.whitebox.EppMetrics;
|
||||
import google.registry.monitoring.whitebox.EppMetric;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeHttpSession;
|
||||
@@ -91,7 +91,7 @@ public class FlowRunnerTest extends ShardableTestCase {
|
||||
flowRunner.isDryRun = false;
|
||||
flowRunner.isSuperuser = false;
|
||||
flowRunner.isTransactional = false;
|
||||
flowRunner.metrics = mock(EppMetrics.class);
|
||||
flowRunner.metric = mock(EppMetric.Builder.class);
|
||||
flowRunner.sessionMetadata =
|
||||
new StatelessRequestSessionMetadata("TheRegistrar", ImmutableSet.<String>of());
|
||||
flowRunner.trid = Trid.create("client-123", "server-456");
|
||||
@@ -113,7 +113,7 @@ public class FlowRunnerTest extends ShardableTestCase {
|
||||
public void testRun_notIsTransactional_callsMetricIncrementAttempts() throws Exception {
|
||||
flowRunner.run();
|
||||
|
||||
verify(flowRunner.metrics).incrementAttempts();
|
||||
verify(flowRunner.metric).incrementAttempts();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -121,7 +121,7 @@ public class FlowRunnerTest extends ShardableTestCase {
|
||||
flowRunner.isTransactional = true;
|
||||
flowRunner.run();
|
||||
|
||||
verify(flowRunner.metrics).incrementAttempts();
|
||||
verify(flowRunner.metric).incrementAttempts();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user