List of usage examples for org.springframework.context.annotation AnnotationConfigApplicationContext containsBean
@Override public boolean containsBean(String name)
From source file:com.netflix.genie.web.security.SecurityConditionsUnitTests.java
/** * Test to make sure that when no supported security is enabled the class doesn't fire. * * @throws Exception on any error//from w w w. j a va2s. c o m */ @Test public void cantEnableBeanWithoutAnySecurityEnabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(SecurityEnabled.class); Assert.assertFalse(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.oauth2.pingfederate.PingFederateConditionsUnitTests.java
/** * Test to make sure that when no supported security is enabled the class doesn't fire. * * @throws Exception on any error/*from www .j a v a2 s.co m*/ */ @Test public void cantEnableJWTBeanWithoutAnySecurityEnabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(PingFederateJWTEnabledConfig.class); Assert.assertFalse(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.oauth2.pingfederate.PingFederateConditionsUnitTests.java
/** * Test to make sure that when no supported security is enabled the class doesn't fire. * * @throws Exception on any error// w w w . ja v a 2 s.c o m */ @Test public void cantEnableRemoteBeanWithoutAnySecurityEnabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(PingFederateRemoteEnabledConfig.class); Assert.assertFalse(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.SecurityConditionsUnitTests.java
/** * Test to make sure that when a supported security is enabled the class fires. * * @throws Exception on any error//from ww w. j a v a 2 s . co m */ @Test public void canEnableBeanWithAllSecurityEnabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(SecurityEnabled.class, "genie.security.saml.enabled:true", "genie.security.x509.enabled:true", "genie.security.oauth2.enabled:true"); Assert.assertTrue(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.SecurityConditionsUnitTests.java
/** * Test to make sure that when a supported security is enabled the class fires. * * @throws Exception on any error//from w w w.j a va 2 s. c om */ @Test public void canEnableBeanWithSAMLEnabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(SecurityEnabled.class, "genie.security.saml.enabled:true", "genie.security.x509.enabled:false", "genie.security.oauth2.enabled:false"); Assert.assertTrue(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.SecurityConditionsUnitTests.java
/** * Test to make sure that when a supported security is enabled the class fires. * * @throws Exception on any error/*from w ww. j av a2 s.co m*/ */ @Test public void canEnableBeanWithX509Enabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(SecurityEnabled.class, "genie.security.saml.enabled:false", "genie.security.x509.enabled:true", "genie.security.oauth2.enabled:false"); Assert.assertTrue(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.SecurityConditionsUnitTests.java
/** * Test to make sure that when a supported security is enabled the class fires. * * @throws Exception on any error//from w ww.java 2 s.c o m */ @Test public void canEnableBeanWithOAuth2Enabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(SecurityEnabled.class, "genie.security.saml.enabled:false", "genie.security.x509.enabled:false", "genie.security.oauth2.enabled:true"); Assert.assertTrue(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.oauth2.pingfederate.PingFederateConditionsUnitTests.java
/** * Test to make sure that when a supported security is enabled the class fires. * * @throws Exception on any error/*from w w w. j av a 2 s . c om*/ */ @Test public void canEnableBeanWithAllJWTConditionsEnabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(PingFederateJWTEnabledConfig.class, "genie.security.oauth2.enabled:true", "genie.security.oauth2.pingfederate.enabled:true", "genie.security.oauth2.pingfederate.jwt.enabled:true"); Assert.assertTrue(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.oauth2.pingfederate.PingFederateConditionsUnitTests.java
/** * Test to make sure that when a supported security is missing the class doesn't fire. * * @throws Exception on any error/* www. j a v a2 s.co m*/ */ @Test public void cantEnableBeanWithAnyJWTConditionsMissing() throws Exception { final AnnotationConfigApplicationContext context = this.load(PingFederateJWTEnabledConfig.class, "genie.security.oauth2.enabled:true", "genie.security.oauth2.pingfederate.enabled:true", "genie.security.oauth2.pingfederate.jwt.enabled:false"); Assert.assertFalse(context.containsBean("myBean")); context.close(); }
From source file:com.netflix.genie.web.security.oauth2.pingfederate.PingFederateConditionsUnitTests.java
/** * Test to make sure that when a supported security is enabled the class fires. * * @throws Exception on any error//from ww w . ja v a2s. c o m */ @Test public void canEnableBeanWithAllRemoteConditionsEnabled() throws Exception { final AnnotationConfigApplicationContext context = this.load(PingFederateRemoteEnabledConfig.class, "genie.security.oauth2.enabled:true", "genie.security.oauth2.pingfederate.enabled:true", "genie.security.oauth2.pingfederate.jwt.enabled:false"); Assert.assertTrue(context.containsBean("myBean")); context.close(); }