@Test void serializeCurrentUserReferenceWhenNoCurrentUser() { when(this.currentUserReferenceUserReferenceResolver.resolve(null)).thenReturn(GuestUserReference.INSTANCE); assertEquals("XWiki.XWikiGuest", this.serializer.serialize(CurrentUserReference.INSTANCE)); }
@Override public String serialize(UserReference userReference) { String result; if (userReference == null) { result = null; } else if (SuperAdminUserReference.INSTANCE == userReference) { result = SUPERADMIN_REFERENCE_STRING; } else if (GuestUserReference.INSTANCE == userReference) { result = GUEST_REFERENCE_STRING; } else if (CurrentUserReference.INSTANCE == userReference) { UserReference resolvedUserReference = this.currentUserReferenceUserReferenceResolver.resolve(null); if (GuestUserReference.INSTANCE == resolvedUserReference) { result = GUEST_REFERENCE_STRING; } else { result = serializeInternal(resolvedUserReference); } } else { result = serializeInternal(userReference); } return result; }
DocumentStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { String result; if (userReference == null) { result = null; } else if (SuperAdminUserReference.INSTANCE == userReference) { result = SUPERADMIN_REFERENCE_STRING; } else if (GuestUserReference.INSTANCE == userReference) { result = GUEST_REFERENCE_STRING; } else if (CurrentUserReference.INSTANCE == userReference) { UserReference resolvedUserReference = this.currentUserReferenceUserReferenceResolver.resolve(null); if (GuestUserReference.INSTANCE == resolvedUserReference) { result = GUEST_REFERENCE_STRING; } else { result = serializeInternal(resolvedUserReference); } } else { result = serializeInternal(userReference); } return result; } }
DocumentStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { String result; if (userReference == null) { result = null; } else if (SuperAdminUserReference.INSTANCE == userReference) { result = SUPERADMIN_REFERENCE_STRING; } else if (GuestUserReference.INSTANCE == userReference) { result = GUEST_REFERENCE_STRING; } else if (CurrentUserReference.INSTANCE == userReference) { UserReference resolvedUserReference = this.currentUserReferenceUserReferenceResolver.resolve(null); if (GuestUserReference.INSTANCE == resolvedUserReference) { result = GUEST_REFERENCE_STRING; } else { result = serializeInternal(resolvedUserReference); } } else { result = serializeInternal(userReference); } return result; }  }
DocumentStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { String result; if (userReference == null) { result = null; } else if (SuperAdminUserReference.INSTANCE == userReference) { result = SUPERADMIN_REFERENCE_STRING; } else if (GuestUserReference.INSTANCE == userReference) { result = GUEST_REFERENCE_STRING; } else if (CurrentUserReference.INSTANCE == userReference) { UserReference resolvedUserReference = this.currentUserReferenceUserReferenceResolver.resolve(null); if (GuestUserReference.INSTANCE == resolvedUserReference) { result = GUEST_REFERENCE_STRING; } else { result = serializeInternal(resolvedUserReference); } } else { result = serializeInternal(userReference); } return result; }  @Override String serialize(UserReference userReference); }
DocumentStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { String result; if (userReference == null) { result = null; } else if (SuperAdminUserReference.INSTANCE == userReference) { result = SUPERADMIN_REFERENCE_STRING; } else if (GuestUserReference.INSTANCE == userReference) { result = GUEST_REFERENCE_STRING; } else if (CurrentUserReference.INSTANCE == userReference) { UserReference resolvedUserReference = this.currentUserReferenceUserReferenceResolver.resolve(null); if (GuestUserReference.INSTANCE == resolvedUserReference) { result = GUEST_REFERENCE_STRING; } else { result = serializeInternal(resolvedUserReference); } } else { result = serializeInternal(userReference); } return result; }  @Override String serialize(UserReference userReference);  }