Centralize RDAP test initialization and login

All RDAP actions inherit from a common RdapActionBase class.

All RDAP search actions inherit from a comman RdapSearchActionBase class, which inherits from RdapActionBase

Each of the base classes has @Before initialization needed for the tests, as well as utility functions (such as login and logout).

Currently, these were copied in all test classes. Instead, we created a similar test inheritance tree to centralize the initialization and place common utility functions.

This way, the @Before of every test only needs to initialize the variables new to the specific action, making the code somewhat clearer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217856844
This commit is contained in:
guyben 2018-10-19 05:37:29 -07:00 committed by jianglai
parent b254269d2f
commit 3a3b0b738a
45 changed files with 456 additions and 758 deletions

View file

@ -23,7 +23,6 @@ import google.registry.rdap.RdapJsonFormatter.BoilerplateType;
import google.registry.rdap.RdapMetrics.EndpointType;
import google.registry.request.Action;
import google.registry.request.auth.Auth;
import google.registry.util.Clock;
import javax.inject.Inject;
/** RDAP (new WHOIS) action for help requests. */
@ -37,8 +36,7 @@ public class RdapHelpAction extends RdapActionBase {
public static final String PATH = "/rdap/help";
@Inject Clock clock;
@Inject RdapHelpAction() {}
@Inject public RdapHelpAction() {}
@Override
public String getHumanReadableObjectTypeName() {