mirror of
https://github.com/google/nomulus
synced 2026-01-10 07:57:58 +00:00
Only inject EPP metric builder in a single place
This fixes recording of number of attempts and command name on EPP flows, which was broken because a separate metric builder was being injected in two places, EppController and FlowRunner, with the one injected into FlowRunner being discarded rather than having changes applied to the same instance as in EppController. This also adds a test that the metric is created successfully inside a flow. Note that tests already exist for EppController to ensure that the metric is recorded correctly. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=152306596
This commit is contained in:
@@ -75,14 +75,14 @@ public class EppControllerTest extends ShardableTestCase {
|
||||
.thenReturn(flowComponentBuilder);
|
||||
when(flowComponentBuilder.build()).thenReturn(flowComponent);
|
||||
when(flowComponent.flowRunner()).thenReturn(flowRunner);
|
||||
when(flowRunner.run()).thenReturn(eppOutput);
|
||||
when(eppOutput.isResponse()).thenReturn(true);
|
||||
when(eppOutput.getResponse()).thenReturn(eppResponse);
|
||||
when(eppResponse.getResult()).thenReturn(result);
|
||||
when(result.getCode()).thenReturn(Code.SUCCESS_WITH_NO_MESSAGES);
|
||||
|
||||
eppController = new EppController();
|
||||
eppController.metricBuilder = EppMetric.builderForRequest("request-id-1", clock);
|
||||
eppController.eppMetricBuilder = EppMetric.builderForRequest("request-id-1", clock);
|
||||
when(flowRunner.run(eppController.eppMetricBuilder)).thenReturn(eppOutput);
|
||||
eppController.bigQueryMetricsEnqueuer = metricsEnqueuer;
|
||||
eppController.flowComponentBuilder = flowComponentBuilder;
|
||||
eppController.eppMetrics = eppMetrics;
|
||||
|
||||
Reference in New Issue
Block a user