mirror of
https://github.com/google/nomulus.git
synced 2025-07-09 20:53:26 +02:00
Avoid mocking in tests for EppMetric
Followup to [] Mocking shouldn't be used when you can use the real implementation just as easily (and more robustly) - in particular, you almost never want to mock a value type. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132586826
This commit is contained in:
parent
e478fd09fb
commit
36c6d59fee
4 changed files with 26 additions and 29 deletions
|
@ -87,13 +87,12 @@ public class LoginFlowViaConsoleTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
Environment login(final String name, final String authDomain, final String gaeUserId) {
|
||||
oldEnv = ApiProxy.getCurrentEnvironment();
|
||||
// This envAttr thing is the only way to set userId.
|
||||
// see https://code.google.com/p/googleappengine/issues/detail?id=3579
|
||||
final HashMap<String, Object> envAttr = new HashMap<>();
|
||||
final HashMap<String, Object> envAttr = new HashMap<>(oldEnv.getAttributes());
|
||||
envAttr.put("com.google.appengine.api.users.UserService.user_id_key", gaeUserId);
|
||||
|
||||
// And then.. this.
|
||||
oldEnv = ApiProxy.getCurrentEnvironment();
|
||||
final Environment e = oldEnv;
|
||||
ApiProxy.setEnvironmentForCurrentThread(new Environment() {
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue