@Test void resolveWhenNoCurrentUser() { XWikiContext xcontext = mock(XWikiContext.class); when(xcontext.getUserReference()).thenReturn(null); when(this.contextProvider.get()).thenReturn(xcontext); UserReference userReference = this.resolver.resolve(null); assertSame(GuestUserReference.INSTANCE, userReference); }
@Override public UserReference resolve(CurrentUserReference unused, Object... parameters) { UserReference userReference; DocumentReference currentDocumentReference = getXWikiContext().getUserReference(); if (currentDocumentReference == null) { userReference = GuestUserReference.INSTANCE; } else { userReference = this.documentReferenceUserReferenceResolver.resolve(currentDocumentReference); } return userReference; }
CurrentUserReferenceResolver implements UserReferenceResolver<CurrentUserReference> { @Override public UserReference resolve(CurrentUserReference unused, Object... parameters) { UserReference userReference; DocumentReference currentDocumentReference = getXWikiContext().getUserReference(); if (currentDocumentReference == null) { userReference = GuestUserReference.INSTANCE; } else { userReference = this.documentReferenceUserReferenceResolver.resolve(currentDocumentReference); } return userReference; } }
CurrentUserReferenceResolver implements UserReferenceResolver<CurrentUserReference> { @Override public UserReference resolve(CurrentUserReference unused, Object... parameters) { UserReference userReference; DocumentReference currentDocumentReference = getXWikiContext().getUserReference(); if (currentDocumentReference == null) { userReference = GuestUserReference.INSTANCE; } else { userReference = this.documentReferenceUserReferenceResolver.resolve(currentDocumentReference); } return userReference; }  }
CurrentUserReferenceResolver implements UserReferenceResolver<CurrentUserReference> { @Override public UserReference resolve(CurrentUserReference unused, Object... parameters) { UserReference userReference; DocumentReference currentDocumentReference = getXWikiContext().getUserReference(); if (currentDocumentReference == null) { userReference = GuestUserReference.INSTANCE; } else { userReference = this.documentReferenceUserReferenceResolver.resolve(currentDocumentReference); } return userReference; }  @Override UserReference resolve(CurrentUserReference unused, Object... parameters); }
CurrentUserReferenceResolver implements UserReferenceResolver<CurrentUserReference> { @Override public UserReference resolve(CurrentUserReference unused, Object... parameters) { UserReference userReference; DocumentReference currentDocumentReference = getXWikiContext().getUserReference(); if (currentDocumentReference == null) { userReference = GuestUserReference.INSTANCE; } else { userReference = this.documentReferenceUserReferenceResolver.resolve(currentDocumentReference); } return userReference; }  @Override UserReference resolve(CurrentUserReference unused, Object... parameters);  }