Move two enums from FlowRunner to FlowTestCase.

They are only needed in test code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125126550
This commit is contained in:
cgoldfeder 2016-06-16 18:54:40 -07:00 committed by Ben McIlwain
parent 038d3d5031
commit 31ddced437
23 changed files with 37 additions and 86 deletions

View file

@ -22,8 +22,6 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import google.registry.flows.FlowRunner.CommitMode;
import google.registry.flows.FlowRunner.UserPrivileges;
import google.registry.model.eppcommon.Trid;
import google.registry.model.eppinput.EppInput;
import google.registry.model.eppoutput.EppOutput;
@ -61,10 +59,7 @@ public final class EppController {
ImmutableList<String> targetIds = eppInput.getTargetIds();
metrics.setCommandName(eppInput.getCommandName());
metrics.setClientId(sessionMetadata.getClientId());
metrics.setPrivilegeLevel(
sessionMetadata.isSuperuser()
? UserPrivileges.SUPERUSER.toString()
: UserPrivileges.NORMAL.toString());
metrics.setPrivilegeLevel(sessionMetadata.isSuperuser() ? "SUPERUSER" : "NORMAL");
if (!targetIds.isEmpty()) {
metrics.setEppTarget(Joiner.on(",").join(targetIds));
}
@ -76,9 +71,7 @@ public final class EppController {
inputXmlBytes,
metrics,
clock);
EppOutput eppOutput = flowRunner.run(
sessionMetadata.isDryRun() ? CommitMode.DRY_RUN : CommitMode.LIVE,
sessionMetadata.isSuperuser() ? UserPrivileges.SUPERUSER : UserPrivileges.NORMAL);
EppOutput eppOutput = flowRunner.run();
if (eppOutput.isResponse()) {
metrics.setEppStatus(eppOutput.getResponse().getResult().getCode());
}