mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Fix bug in test
This commit is contained in:
parent
514cf3dcc1
commit
35a376b403
@ -17,6 +17,7 @@
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.properties.EndpointsProperties;
|
||||
import org.springframework.bootstrap.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -41,7 +42,7 @@ public class SecurityConfigurationTests {
|
||||
public void testWebConfiguration() throws Exception {
|
||||
this.context = new AnnotationConfigWebApplicationContext();
|
||||
this.context.setServletContext(new MockServletContext());
|
||||
this.context.register(SecurityConfiguration.class,
|
||||
this.context.register(SecurityConfiguration.class, EndpointsProperties.class,
|
||||
PropertyPlaceholderAutoConfiguration.class);
|
||||
this.context.refresh();
|
||||
assertNotNull(this.context.getBean(AuthenticationManager.class));
|
||||
@ -52,7 +53,7 @@ public class SecurityConfigurationTests {
|
||||
this.context = new AnnotationConfigWebApplicationContext();
|
||||
this.context.setServletContext(new MockServletContext());
|
||||
this.context.register(TestConfiguration.class, SecurityConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class);
|
||||
EndpointsProperties.class, PropertyPlaceholderAutoConfiguration.class);
|
||||
this.context.refresh();
|
||||
assertEquals(this.context.getBean(TestConfiguration.class).authenticationManager,
|
||||
this.context.getBean(AuthenticationManager.class));
|
||||
|
Loading…
Reference in New Issue
Block a user