Change the LoadTestAction to use /_dr/epptool

The load tests used to directly build EPP, but that becomes
problematic for an upcoming CL that refactors a lot of the
EPP flow code. Instead, use the existing tool endpoint
(conveniently, LoadTestAction is already in the tools module).
This required changing the EppToolServlet to get its
xml from a param rather than from the request payload,
since task queues won't allow both a payload and request
params on the same task.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124351878
This commit is contained in:
Corey Goldfeder 2016-06-08 07:51:02 -07:00 committed by Justine Tunney
parent 5a2f63cf58
commit 366c5a344d
19 changed files with 227 additions and 255 deletions

View file

@ -22,14 +22,15 @@ import com.beust.jcommander.ParameterException;
import google.registry.model.registry.Registry;
import org.junit.Before;
import org.junit.Test;
/** Unit tests for {@link CreateAnchorTenantCommand}. */
public class CreateAnchorTenantCommandTest
extends EppToolCommandTestCase<CreateAnchorTenantCommand> {
@Override
void initEppToolCommandTestCase() {
@Before
public void initCommand() {
command.passwordGenerator = new FakePasswordGenerator("abcdefghijklmnopqrstuvwxyz");
}
@ -37,35 +38,35 @@ public class CreateAnchorTenantCommandTest
public void testSuccess() throws Exception {
runCommandForced("--client=NewRegistrar", "--superuser",
"--reason=anchor-tenant-test", "--contact=jd1234", "--domain_name=example.tld");
eppVerifier().asSuperuser().verifySent("testdata/domain_create_anchor_tenant.xml");
eppVerifier().asSuperuser().verifySent("domain_create_anchor_tenant.xml");
}
@Test
public void testSuccess_suppliedPassword() throws Exception {
runCommandForced("--client=NewRegistrar", "--superuser", "--password=foo",
"--reason=anchor-tenant-test", "--contact=jd1234", "--domain_name=example.tld");
eppVerifier().asSuperuser().verifySent("testdata/domain_create_anchor_tenant_password.xml");
eppVerifier().asSuperuser().verifySent("domain_create_anchor_tenant_password.xml");
}
@Test
public void testSuccess_multipleWordReason() throws Exception {
runCommandForced("--client=NewRegistrar", "--superuser",
"--reason=\"anchor tenant test\"", "--contact=jd1234", "--domain_name=example.tld");
eppVerifier().asSuperuser().verifySent("testdata/domain_create_anchor_tenant_multiple_word_reason.xml");
eppVerifier().asSuperuser().verifySent("domain_create_anchor_tenant_multiple_word_reason.xml");
}
@Test
public void testSuccess_noReason() throws Exception {
runCommandForced("--client=NewRegistrar", "--superuser",
"--contact=jd1234", "--domain_name=example.tld");
eppVerifier().asSuperuser().verifySent("testdata/domain_create_anchor_tenant_no_reason.xml");
eppVerifier().asSuperuser().verifySent("domain_create_anchor_tenant_no_reason.xml");
}
@Test
public void testSuccess_feeStandard() throws Exception {
runCommandForced("--client=NewRegistrar", "--superuser", "--fee",
"--reason=anchor-tenant-test", "--contact=jd1234", "--domain_name=example.tld");
eppVerifier().asSuperuser().verifySent("testdata/domain_create_anchor_tenant_fee_standard.xml");
eppVerifier().asSuperuser().verifySent("domain_create_anchor_tenant_fee_standard.xml");
}
@Test
@ -78,7 +79,7 @@ public class CreateAnchorTenantCommandTest
.build());
runCommandForced("--client=NewRegistrar", "--superuser", "--fee",
"--reason=anchor-tenant-test", "--contact=jd1234", "--domain_name=premium.tld");
eppVerifier().asSuperuser().verifySent("testdata/domain_create_anchor_tenant_fee_premium.xml");
eppVerifier().asSuperuser().verifySent("domain_create_anchor_tenant_fee_premium.xml");
}
@Test