mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02: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:
parent
794743c7bc
commit
4606b1d08e
7 changed files with 58 additions and 36 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue