google-nomulus/javatests/google/registry
nickfelt ceb5c2117e Decouple GaeUserCredentials from UserService and simplify tests
This disentangles GaeUserCredentials and UserService, which lets us remove a
bunch of hacky and brittle code from LoginFlowViaConsoleTest.

Previously, GaeUserCredentials was constructed for a user, but then was still
directly calling UserService to check if the user was an admin.  UserService
can be adjusted in tests (via AppEngineRule / LocalServiceTestHelper) but it's
a pain, especially to do dynamically within a single test file.  The hacky
code in LoginFlowViaConsoleTest was working around that restriction.

With this CL, you can pass into GaeUserCredentials whether the user is an
admin or not (for testing) or construct one directly from a UserService object
(for production, and for convenience in tests using an AppEngineRule user).

Note that I also changed EppConsoleAction to @Inject UserService.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132696391
2016-09-14 15:36:53 -04:00
..
backup Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
bigquery Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
billing Reduce mapreduce shards in tests 2016-08-05 20:41:53 -04:00
builddefs Create zip_file() rule 2016-08-02 19:17:55 -04:00
config Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
cron Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
dns DeReference the codebase 2016-09-02 13:50:20 -04:00
export DeReference the codebase 2016-09-02 13:50:20 -04:00
flows Decouple GaeUserCredentials from UserService and simplify tests 2016-09-14 15:36:53 -04:00
groups Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
mapreduce/inputs Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
model HistoryEntry for extra logic; update fee check 2016-09-14 15:28:03 -04:00
module Wire in MetricsReporter to FrontendServlet 2016-09-07 11:52:59 -04:00
monitoring Fix incorrect field name in EppMetric 2016-09-14 15:35:25 -04:00
pricing Add extra logic for all relevant flows 2016-09-14 15:26:36 -04:00
rdap DeReference the codebase 2016-09-02 13:50:20 -04:00
rde DeReference the codebase 2016-09-02 13:50:20 -04:00
request Remove unused request parameter extractor 2016-08-22 14:24:44 -04:00
security Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
server DeReference the codebase 2016-09-02 13:50:20 -04:00
storage/drive Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
testing Shard all [] tests 2016-09-07 12:13:42 -04:00
tldconfig/idn Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
tmch DeReference the codebase 2016-09-02 13:50:20 -04:00
tools Allow PasswordGenerator to use different alphabets 2016-09-07 12:07:58 -04:00
ui Standardize test methods to be prefixed with "test" 2016-08-26 09:41:52 -04:00
util Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
whois DeReference the codebase 2016-09-02 13:50:20 -04:00
xjc Normalize expected exception handling in tests 2016-08-02 19:16:19 -04:00
xml Normalize expected exception handling in tests 2016-08-02 19:16:19 -04:00