### Question:
SecurityConfig { @Bean(name = "authenticator") public Authenticator authenticator() { setAuthenticationType(type); Authenticator authenticator; switch (authenticationType) { case PASSWORD: authenticator = new PasswordAuthenticator(); break; default: throw new IllegalStateException("Unexpected value: " + authenticationType); } beanFactory.autowireBean(authenticator); return authenticator; } @Autowired  SecurityConfig(AutowireCapableBeanFactory beanFactory); @Bean(name = "authenticator") Authenticator authenticator();  }### Answer:
@Test public void testAuthenticator() { Authenticator authenticator = securityConfig.authenticator(); Assert.assertNotNull(authenticator); }