diff --git a/core/src/test/java/org/springframework/security/config/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java b/core/src/test/java/org/springframework/security/config/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java
index 77175ce5d1..047e81aad6 100644
--- a/core/src/test/java/org/springframework/security/config/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java
+++ b/core/src/test/java/org/springframework/security/config/CustomAuthenticationProviderBeanDefinitionDecoratorTests.java
@@ -8,9 +8,25 @@ import org.springframework.security.util.InMemoryXmlApplicationContext;
public class CustomAuthenticationProviderBeanDefinitionDecoratorTests {
-
+
@Test
public void decoratedProviderParsesSuccessfully() {
+ InMemoryXmlApplicationContext ctx = new InMemoryXmlApplicationContext(
+ "" +
+ " " +
+ " " +
+ "" +
+ "" +
+ " " +
+ ""
+ );
+ ProviderManager authMgr = (ProviderManager) ctx.getBean(BeanIds.AUTHENTICATION_MANAGER);
+ assertEquals(1, authMgr.getProviders().size());
+ }
+
+
+ @Test
+ public void decoratedBeanAndRegisteredProviderAreTheSameObject() {
InMemoryXmlApplicationContext ctx = new InMemoryXmlApplicationContext(
"" +
" " +
@@ -18,15 +34,11 @@ public class CustomAuthenticationProviderBeanDefinitionDecoratorTests {
"" +
"" +
" " +
- " " +
""
-
);
-
- Object myProvider = ctx.getBean("myProvider");
-
+
ProviderManager authMgr = (ProviderManager) ctx.getBean(BeanIds.AUTHENTICATION_MANAGER);
-
- assertSame(myProvider, authMgr.getProviders().get(0));
+ assertEquals(1, authMgr.getProviders().size());
+ assertSame(ctx.getBean("myProvider"), authMgr.getProviders().get(0));
}
}