Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public class BulkDomainTransferCommand extends ConfirmingCommand implements Comm

@Parameter(
names = {"--registrar_request"},
description = "Whether the change was requested by a registrar.")
description = "Whether the change was requested by a registrar.",
arity = 1)
private boolean requestedByRegistrar = false;

@Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ final class DeleteDomainCommand extends MutatingEppToolCommand {

@Parameter(
names = {"--registrar_request"},
description = "Whether the change was requested by a registrar.")
description = "Whether the change was requested by a registrar.",
arity = 1)
private boolean requestedByRegistrar = false;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,32 @@ void testFailure_bothDomainMethodsSpecified() {
.isEqualTo(
"Must specify exactly one input method, either --domains or --domain_names_file");
}

@Test
void testSuccess_registrarRequestExplicit() throws Exception {
runCommandForced(
"--gaining_registrar_id",
"NewRegistrar",
"--losing_registrar_id",
"TheRegistrar",
"--reason",
"someReason",
"--domains",
"foo.tld,bar.tld",
"--registrar_request=false");
verify(connection)
.sendPostRequest(
"/_dr/task/bulkDomainTransfer",
ImmutableMap.of(
"gainingRegistrarId",
"NewRegistrar",
"losingRegistrarId",
"TheRegistrar",
"requestedByRegistrar",
false,
"reason",
"someReason"),
MediaType.PLAIN_TEXT_UTF_8,
"[\"foo.tld\",\"bar.tld\"]".getBytes(UTF_8));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,20 @@ void testSuccess_requestedByRegistrarTrue() throws Exception {
"--client=NewRegistrar",
"--domain_name=example.tld",
"--reason=Test",
"--registrar_request");
"--registrar_request=true");
eppVerifier.verifySent("domain_delete_by_registrar.xml");
}

@Test
void testSuccess_requestedByRegistrarExplicitFalse() throws Exception {
runCommandForced(
"--client=NewRegistrar",
"--domain_name=example.tld",
"--reason=Test",
"--registrar_request=false");
eppVerifier.verifySent("domain_delete.xml");
}

@Test
void testFailure_noReason() {
assertThrows(
Expand Down
Loading