mirror of
https://github.com/google/nomulus
synced 2026-01-09 23:47:49 +00:00
Refactor out creation of server TRIDs so they can be tested
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=152837185
This commit is contained in:
@@ -50,6 +50,7 @@ public final class EppController {
|
||||
@Inject EppMetric.Builder eppMetricBuilder;
|
||||
@Inject EppMetrics eppMetrics;
|
||||
@Inject BigQueryMetricsEnqueuer bigQueryMetricsEnqueuer;
|
||||
@Inject ServerTridProvider serverTridProvider;
|
||||
@Inject EppController() {}
|
||||
|
||||
/** Reads EPP XML, executes the matching flow, and returns an {@link EppOutput}. */
|
||||
@@ -83,7 +84,8 @@ public final class EppController {
|
||||
Strings.repeat("=", 40));
|
||||
// Return early by sending an error message, with no clTRID since we couldn't unmarshal it.
|
||||
eppMetricBuilder.setStatus(e.getResult().getCode());
|
||||
return getErrorResponse(e.getResult(), Trid.create(null));
|
||||
return getErrorResponse(
|
||||
e.getResult(), Trid.create(null, serverTridProvider.createServerTrid()));
|
||||
}
|
||||
if (!eppInput.getTargetIds().isEmpty()) {
|
||||
eppMetricBuilder.setEppTarget(Joiner.on(',').join(eppInput.getTargetIds()));
|
||||
|
||||
Reference in New Issue
Block a user