mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 20:18:34 +02:00
Tweak the registrar-ote-setup web console
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=227736173
This commit is contained in:
parent
338f7343ba
commit
2af24c945c
5 changed files with 71 additions and 19 deletions
|
@ -97,6 +97,7 @@ public final class ConsoleOteSetupActionTest {
|
|||
action.productName = "Nomulus";
|
||||
action.clientId = Optional.empty();
|
||||
action.email = Optional.empty();
|
||||
action.optionalPassword = Optional.empty();
|
||||
action.passwordGenerator = new DeterministicStringGenerator("abcdefghijklmnopqrstuvwxyz");
|
||||
|
||||
message = new MimeMessage(Session.getDefaultInstance(new Properties(), null));
|
||||
|
@ -160,6 +161,24 @@ public final class ConsoleOteSetupActionTest {
|
|||
+ "Gave user contact@registry.example web access to these Registrars\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPost_authorized_setPassword() throws Exception {
|
||||
action.clientId = Optional.of("myclientid");
|
||||
action.email = Optional.of("contact@registry.example");
|
||||
action.optionalPassword = Optional.of("SomePassword");
|
||||
action.method = Method.POST;
|
||||
action.run();
|
||||
|
||||
// We just check some samples to make sure OteAccountBuilder was called successfully. We aren't
|
||||
// checking that all the entities are there or that they have the correct values.
|
||||
assertThat(loadByClientId("myclientid-4").get().testPassword("SomePassword"))
|
||||
.isTrue();
|
||||
assertThat(response.getPayload())
|
||||
.contains("<h1>OT&E successfully created for registrar myclientid!</h1>");
|
||||
assertThat(response.getPayload())
|
||||
.contains("SomePassword");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPost_unauthorized() {
|
||||
action.registrarAccessor =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue