mirror of
https://github.com/google/nomulus.git
synced 2025-08-02 16:02:10 +02:00
Check registrar existence prior to verifying access
This way the error messages are more sensible when a registrar doesn't exist (which realistically shouldn't happen in the typical case anyway). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=240376239
This commit is contained in:
parent
bb09f259b3
commit
4240be268a
3 changed files with 6 additions and 8 deletions
|
@ -113,14 +113,15 @@ public final class OteStatusActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_noRegistrar() {
|
||||
public void testFailure_registrarDoesntExist() {
|
||||
assertThat(action.handleJsonRequest(ImmutableMap.of("clientId", "nonexistent-3")))
|
||||
.containsExactlyEntriesIn(
|
||||
errorResultWithMessage("TestUserId doesn't have access to registrar nonexistent-3"));
|
||||
errorResultWithMessage("Registrar nonexistent-3 does not exist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_notAuthorized() {
|
||||
persistNewRegistrar(CLIENT_ID, "blobio-1", Type.REAL, 1L);
|
||||
action.registrarAccessor =
|
||||
AuthenticatedRegistrarAccessor.createForTesting(ImmutableSetMultimap.of());
|
||||
assertThat(action.handleJsonRequest(ImmutableMap.of("clientId", CLIENT_ID)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue