From e1602fe59a833692d54c60ac34d7da29224acfaa Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 31 Jul 2017 20:34:56 -0700 Subject: [PATCH] Polish --- .../EndpointWebMvcAutoConfigurationTests.java | 1 - .../security/SecurityAutoConfigurationTests.java | 7 ------- 2 files changed, 8 deletions(-) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java index cfe0704c4b..72b0f109cb 100755 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java @@ -574,7 +574,6 @@ public class EndpointWebMvcAutoConfigurationTests { "server.ssl.enabled=true", "server.ssl.key-store=classpath:test.jks", "server.ssl.key-password=password", "management.ssl.enabled=false") .applyTo(this.applicationContext); - this.applicationContext.register(RootConfig.class, EndpointConfig.class, DifferentPortConfig.class, BaseConfiguration.class, EndpointWebMvcAutoConfiguration.class, ErrorMvcAutoConfiguration.class); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java index 6c5360a0a4..37fa34c611 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java @@ -293,13 +293,10 @@ public class SecurityAutoConfigurationTests { public void testDefaultUsernamePassword() throws Exception { this.context = new AnnotationConfigWebApplicationContext(); this.context.setServletContext(new MockServletContext()); - this.context.register(SecurityAutoConfiguration.class); this.context.refresh(); - SecurityProperties security = this.context.getBean(SecurityProperties.class); AuthenticationManager manager = this.context.getBean(AuthenticationManager.class); - UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken( security.getUser().getName(), security.getUser().getPassword()); assertThat(manager.authenticate(token)).isNotNull(); @@ -310,14 +307,11 @@ public class SecurityAutoConfigurationTests { throws Exception { this.context = new AnnotationConfigWebApplicationContext(); this.context.setServletContext(new MockServletContext()); - this.context.register(AuthenticationManagerCustomizer.class, SecurityAutoConfiguration.class); this.context.refresh(); - SecurityProperties security = this.context.getBean(SecurityProperties.class); AuthenticationManager manager = this.context.getBean(AuthenticationManager.class); - UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken( security.getUser().getName(), security.getUser().getPassword()); try { @@ -327,7 +321,6 @@ public class SecurityAutoConfigurationTests { catch (AuthenticationException success) { // Expected } - token = new UsernamePasswordAuthenticationToken("foo", "bar"); assertThat(manager.authenticate(token)).isNotNull(); }