mirror of
https://github.com/google/nomulus
synced 2026-08-27 19:37:07 +00:00
Refactor assertCommandAndResponse to be "fluent"
This is in preparation for automatic EPP consolidation.
The assertion will now look like:
assertThatCommand("file.xml"[, substitution])
.atTime(time)
.hasResponse("file2.xml"[, substitution]);
Also, added convenience functions for often reused commands (login and logout)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190617505
This commit is contained in:
@@ -42,23 +42,23 @@ public class EppLoginAdminUserTest extends EppTestCase {
|
||||
@Test
|
||||
public void testNonAuthedLogin_succeedsAsAdmin() throws Exception {
|
||||
// Login succeeds even though this user isn't listed on the registrar.
|
||||
assertCommandAndResponse("login2_valid.xml", "login_response.xml");
|
||||
assertThatLoginSucceeds("TheRegistrar", "password2");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoginLogout_wrongPasswordStillWorks() throws Exception {
|
||||
// For user-based logins the password in the epp xml is ignored.
|
||||
assertCommandAndResponse("login_invalid_wrong_password.xml", "login_response.xml");
|
||||
assertCommandAndResponse("logout.xml", "logout_response.xml");
|
||||
assertThatLoginSucceeds("NewRegistrar", "incorrect");
|
||||
assertThatLogoutSucceeds();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonAuthedMultiLogin_succeedsAsAdmin() throws Exception {
|
||||
// The admin can log in as different registrars.
|
||||
assertCommandAndResponse("login_valid.xml", "login_response.xml");
|
||||
assertCommandAndResponse("logout.xml", "logout_response.xml");
|
||||
assertCommandAndResponse("login_valid.xml", "login_response.xml");
|
||||
assertCommandAndResponse("logout.xml", "logout_response.xml");
|
||||
assertCommandAndResponse("login2_valid.xml", "login_response.xml");
|
||||
assertThatLoginSucceeds("NewRegistrar", "foo-BAR2");
|
||||
assertThatLogoutSucceeds();
|
||||
assertThatLoginSucceeds("NewRegistrar", "foo-BAR2");
|
||||
assertThatLogoutSucceeds();
|
||||
assertThatLoginSucceeds("TheRegistrar", "password2");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user