DefaultUserAuthService implements UserAuthService { @Override public String getAuthenticatedUserId() { return retriever.getUserId(); } DefaultUserAuthService(UserService userService, AuthenticationInfoRetriever retriever); @Override User getAuthenticatedUser(); @Override String getAuthenticatedUserId(); @Override boolean authenticatedUserIsAdmin(); @Override boolean userIsEffectivelyAManager(User user);  }
@Test public void getAuthenticatedUserIdReturnsIdOfAuthenticatedUser() { given(retrieverMock.getUserId()).willReturn(USER_ID); var actualId = userAuthService.getAuthenticatedUserId(); assertThat(actualId).isEqualTo(USER_ID); }