test_class.declarator: accountDetailsService
test_class.modifier: @Autowired
test_class.original_string: @Autowired
      AccountDetailsService accountDetailsService;
test_class.type: AccountDetailsService
test_class.var_name: accountDetailsService
test_class.declarator: passwordEncoder = new BCryptPasswordEncoder()
test_class.original_string: BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
test_class.type: BCryptPasswordEncoder
test_class.var_name: passwordEncoder
test_class.file: 02-spring5-answer/src/test/java/com/example/security/details/AccountDetailsServiceTest.java
test_class.identifier: AccountDetailsServiceTest
test_case.body: @Test
      @DisplayName("user@example.comでユーザーを検索できる")
      public void loadUserByUsernameTest1() {
          AccountDetails accountDetails = (AccountDetails) accountDetailsService.loadUserByUsername("user@example.com");
          Account account = accountDetails.getAccount();
          assertNotNull(account);
          List<String> authorities = account.getAuthorities();
          assertEquals(1, authorities.size());
          assertAll(
                  () -> assertEquals(Integer.valueOf(1), account.getId()),
                  () -> assertEquals("user", account.getName()),
                  () -> assertEquals("user@example.com", account.getEmail()),
                  () -> assertTrue(passwordEncoder.matches("user", account.getPassword())),
                  () -> assertTrue(accountDetails.isAccountNonExpired()),
                  () -> assertTrue(accountDetails.isAccountNonLocked()),
                  () -> assertTrue(accountDetails.isCredentialsNonExpired()),
                  () -> assertTrue(accountDetails.isEnabled())
          );
      }
test_case.class_method_signature: AccountDetailsServiceTest.loadUserByUsernameTest1()
test_case.full_signature: @Test @DisplayName("user@example.comでユーザーを検索できる") public void loadUserByUsernameTest1()
test_case.identifier: loadUserByUsernameTest1
test_case.invocations: loadUserByUsername getAccount assertNotNull getAuthorities assertEquals size assertAll assertEquals valueOf getId assertEquals getName assertEquals getEmail assertTrue matches getPassword assertTrue isAccountNonExpired assertTrue isAccountNonLocked assertTrue isCredentialsNonExpired assertTrue isEnabled
test_case.modifiers: @Test @DisplayName("user@example.comでユーザーを検索できる") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void loadUserByUsernameTest1()
focal_class.declarator: accountRepository
focal_class.modifier: private final
focal_class.original_string: private final AccountRepository accountRepository;
focal_class.type: AccountRepository
focal_class.var_name: accountRepository
focal_class.file: 02-spring5-answer/src/main/java/com/example/security/details/AccountDetailsService.java
focal_class.identifier: AccountDetailsService
focal_class.interfaces: implements UserDetailsService
focal_class.class_method_signature: AccountDetailsService.AccountDetailsService(AccountRepository accountRepository)
focal_class.full_signature: public  AccountDetailsService(AccountRepository accountRepository)
focal_class.identifier: AccountDetailsService
focal_class.modifiers: public
focal_class.parameters: (AccountRepository accountRepository)
focal_class.signature:  AccountDetailsService(AccountRepository accountRepository)
focal_class.class_method_signature: AccountDetailsService.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 {
          Optional<Account> accountOptional = accountRepository.findByEmail(username);
          Account account = accountOptional.orElseThrow(() -> new UsernameNotFoundException("user not found"));
          AccountDetails accountDetails = new AccountDetails(account);
          return accountDetails;
      }
focal_method.class_method_signature: AccountDetailsService.loadUserByUsername(String username)
focal_method.full_signature: @Override public UserDetails loadUserByUsername(String username)
focal_method.identifier: loadUserByUsername
focal_method.invocations: findByEmail orElseThrow
focal_method.modifiers: @Override public
focal_method.parameters: (String username)
focal_method.return: UserDetails
focal_method.signature: UserDetails loadUserByUsername(String username)