mirror of
https://github.com/google/nomulus
synced 2026-01-06 13:36:48 +00:00
Refactor SessionMetadata and TransportCredentials toString() methods
This cleanups up the toString() methods of all implementations of these interfaces, as pre-work for adding tests against the legacy logging statement in FlowRunner used for ICANN reporting, so that we can validate against any changes to that log statement in the future. It removes system hash codes since those aren't really safe to rely on in test code and they really don't help with debugging anyway. It also standardizes SessionMetadata.toString() a bit and regroups methods on that interface so all the getters are together. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125686039
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
package google.registry.flows;
|
||||
|
||||
import static com.google.appengine.api.users.UserServiceFactory.getUserService;
|
||||
import static com.google.common.base.MoreObjects.toStringHelper;
|
||||
import static com.google.common.base.Strings.nullToEmpty;
|
||||
import static java.lang.System.identityHashCode;
|
||||
|
||||
import com.google.appengine.api.users.User;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
@@ -59,7 +59,9 @@ public class GaeUserCredentials implements TransportCredentials {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("GaeUserCredentials@%s{gaeUser: %s}", identityHashCode(this), gaeUser);
|
||||
return toStringHelper(getClass())
|
||||
.add("gaeUser", gaeUser)
|
||||
.toString();
|
||||
}
|
||||
|
||||
/** User is not logged in as a GAE user. */
|
||||
|
||||
Reference in New Issue
Block a user