Convert CreateCdnsTld into a ConfirmingCommand

This will result is a prompt like

Creating TLD with:
  projectId= domain-registry-alpha
  description= some description
  dnsName= mytld.
  name= mytld.
  nameServerSet= cloud-dns-registry-test
Perform this command? (y/N):

before actually performing the command, and adds a --force flag to bypass the
prompt.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172369944
This commit is contained in:
guyben 2017-10-16 13:32:02 -07:00 committed by jianglai
parent 03087ddc85
commit af99f64b88
2 changed files with 26 additions and 8 deletions

View file

@ -58,7 +58,7 @@ public class CreateCdnsTldTest extends CommandTestCase<CreateCdnsTld> {
@Test
public void testBasicFunctionality() throws Exception {
runCommand("--dns_name=tld.", "--name=tld", "--description=test run");
runCommand("--dns_name=tld.", "--name=tld", "--description=test run", "--force");
verify(request).execute();
assertThat(projectId.getValue()).isEqualTo("test-project");
ManagedZone zone = requestBody.getValue();
@ -69,7 +69,7 @@ public class CreateCdnsTldTest extends CommandTestCase<CreateCdnsTld> {
@Test
public void testNameDefault() throws Exception {
runCommand("--dns_name=tld.", "--description=test run");
runCommand("--dns_name=tld.", "--description=test run", "--force");
ManagedZone zone = requestBody.getValue();
assertThat(zone.getNameServerSet()).isEqualTo("cloud-dns-registry-test");
assertThat(zone.getDnsName()).isEqualTo("tld.");