mirror of
https://github.com/google/nomulus.git
synced 2025-05-30 09:20:29 +02:00
Correctly set HTTP error status codes when list objects fails
This makes the associated nomulus tool commands correctly return error exit codes when the server-side component fails. This improves scriptability. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140543216
This commit is contained in:
parent
b35ac10b7e
commit
5f32d1bbeb
8 changed files with 31 additions and 11 deletions
|
@ -17,6 +17,7 @@ package google.registry.tools.server;
|
|||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -50,7 +51,8 @@ public class ListDomainsActionTest extends ListActionTestCase {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
"^Must specify TLDs to query$");
|
||||
"^Must specify TLDs to query$",
|
||||
SC_BAD_REQUEST);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -61,7 +63,8 @@ public class ListDomainsActionTest extends ListActionTestCase {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
"^TLD %%%badtld%%% does not exist$");
|
||||
"^TLD %%%badtld%%% does not exist$",
|
||||
SC_BAD_REQUEST);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -229,6 +232,7 @@ public class ListDomainsActionTest extends ListActionTestCase {
|
|||
Optional.of("badfield"),
|
||||
null,
|
||||
null,
|
||||
"^Field 'badfield' not found - recognized fields are:");
|
||||
"^Field 'badfield' not found - recognized fields are:",
|
||||
SC_BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue