test_class.declarator: USER_NAME = "foo@example.com"
test_class.modifier: private static final
test_class.original_string: private static final String USER_NAME = "foo@example.com";
test_class.type: String
test_class.var_name: USER_NAME
test_class.declarator: ENCODED_PASSWORD = "encoded-password"
test_class.modifier: private static final
test_class.original_string: private static final String ENCODED_PASSWORD = "encoded-password";
test_class.type: String
test_class.var_name: ENCODED_PASSWORD
test_class.declarator: AUTH_SERVER_USER = new AuthServerUser(USER_NAME, ENCODED_PASSWORD, false)
test_class.modifier: private static final
test_class.original_string: private static final AuthServerUser AUTH_SERVER_USER = new AuthServerUser(USER_NAME, ENCODED_PASSWORD, false);
test_class.type: AuthServerUser
test_class.var_name: AUTH_SERVER_USER
test_class.declarator: USER_DETAILS = User.builder().username(USER_NAME).password(ENCODED_PASSWORD).roles().build()
test_class.modifier: private static final
test_class.original_string: private static final UserDetails USER_DETAILS = User.builder().username(USER_NAME).password(ENCODED_PASSWORD).roles().build();
test_class.type: UserDetails
test_class.var_name: USER_DETAILS
test_class.declarator: authServerUserReadService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AuthServerUserReadService authServerUserReadService;
test_class.type: AuthServerUserReadService
test_class.var_name: authServerUserReadService
test_class.declarator: authServerUserDetailsService
test_class.modifier: private
test_class.original_string: private AuthServerUserDetailsService authServerUserDetailsService;
test_class.type: AuthServerUserDetailsService
test_class.var_name: authServerUserDetailsService
test_class.file: security-support/src/test/java/engineering/everest/lhotse/security/userdetails/AuthServerUserDetailsServiceTest.java
test_class.identifier: AuthServerUserDetailsServiceTest
test_case.body: @Test
      void willLoadUserByUsername() {
          when(authServerUserReadService.getByUsername(USER_NAME)).thenReturn(AUTH_SERVER_USER);
          UserDetails userDetails = authServerUserDetailsService.loadUserByUsername(USER_NAME);
  
          assertEquals(USER_DETAILS, userDetails);
      }
test_case.class_method_signature: AuthServerUserDetailsServiceTest.willLoadUserByUsername()
test_case.full_signature: @Test void willLoadUserByUsername()
test_case.identifier: willLoadUserByUsername
test_case.invocations: thenReturn when getByUsername loadUserByUsername assertEquals
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void willLoadUserByUsername()
focal_class.declarator: authServerUserReadService
focal_class.modifier: private final
focal_class.original_string: private final AuthServerUserReadService authServerUserReadService;
focal_class.type: AuthServerUserReadService
focal_class.var_name: authServerUserReadService
focal_class.file: security-support/src/main/java/engineering/everest/lhotse/security/userdetails/AuthServerUserDetailsService.java
focal_class.identifier: AuthServerUserDetailsService
focal_class.interfaces: implements AuthenticationServerUserDetailsService
focal_class.class_method_signature: AuthServerUserDetailsService.AuthServerUserDetailsService(AuthServerUserReadService authServerUserReadService)
focal_class.full_signature: @Autowired public  AuthServerUserDetailsService(AuthServerUserReadService authServerUserReadService)
focal_class.identifier: AuthServerUserDetailsService
focal_class.modifiers: @Autowired public
focal_class.parameters: (AuthServerUserReadService authServerUserReadService)
focal_class.signature:  AuthServerUserDetailsService(AuthServerUserReadService authServerUserReadService)
focal_class.class_method_signature: AuthServerUserDetailsService.loadUserByUsername(String username)
focal_class.full_signature: @Override public UserDetails loadUserByUsername(String username)
focal_class.identifier: loadUserByUsername
focal_class.modifiers: @Override public
focal_class.parameters: (String username)
focal_class.return: UserDetails
focal_class.signature: UserDetails loadUserByUsername(String username)
focal_method.body: @Override
      public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
          AuthServerUser authServerUser;
          try {
              authServerUser = authServerUserReadService.getByUsername(username);
          } catch (NoSuchElementException e) {
              throw new UsernameNotFoundException("Invalid credentials", e);
          }
          return org.springframework.security.core.userdetails.User.builder()
                  .username(authServerUser.getUsername())
                  .password(authServerUser.getEncodedPassword())
                  .disabled(authServerUser.isDisabled())
                  .roles()
                  .build();
  
      }
focal_method.class_method_signature: AuthServerUserDetailsService.loadUserByUsername(String username)
focal_method.full_signature: @Override public UserDetails loadUserByUsername(String username)
focal_method.identifier: loadUserByUsername
focal_method.invocations: getByUsername build roles disabled password username builder getUsername getEncodedPassword isDisabled
focal_method.modifiers: @Override public
focal_method.parameters: (String username)
focal_method.return: UserDetails
focal_method.signature: UserDetails loadUserByUsername(String username)