use of cn.taketoday.context.ApplicationContext in project today-infrastructure by TAKETODAY.
the class ConfigurationWithFactoryBeanAndParametersTests method test.
@Test
public void test() {
ApplicationContext ctx = new StandardApplicationContext(Config.class, Bar.class);
assertThat(ctx.getBean(Bar.class).foo).isNotNull();
}
use of cn.taketoday.context.ApplicationContext in project today-infrastructure by TAKETODAY.
the class EnableAspectJAutoProxyTests method withJdkProxy.
@Test
public void withJdkProxy() {
ApplicationContext ctx = new AnnotationConfigApplicationContext(ConfigWithJdkProxy.class);
aspectIsApplied(ctx);
assertThat(AopUtils.isJdkDynamicProxy(ctx.getBean(FooService.class))).isTrue();
}
use of cn.taketoday.context.ApplicationContext in project today-infrastructure by TAKETODAY.
the class PrimitiveBeanLookupAndAutowiringTests method primitiveAutowiredInjection.
@Test
public void primitiveAutowiredInjection() {
ApplicationContext ctx = new StandardApplicationContext(Config.class, AutowiredComponent.class);
assertThat(ctx.getBean(AutowiredComponent.class).b).isEqualTo(true);
assertThat(ctx.getBean(AutowiredComponent.class).i).isEqualTo(42);
}
use of cn.taketoday.context.ApplicationContext in project today-infrastructure by TAKETODAY.
the class PrimitiveBeanLookupAndAutowiringTests method primitiveLookupByName.
@Test
public void primitiveLookupByName() {
ApplicationContext ctx = new StandardApplicationContext(Config.class);
boolean b = ctx.getBean("b", boolean.class);
assertThat(b).isEqualTo(true);
int i = ctx.getBean("i", int.class);
assertThat(i).isEqualTo(42);
}
use of cn.taketoday.context.ApplicationContext in project today-infrastructure by TAKETODAY.
the class PrimitiveBeanLookupAndAutowiringTests method primitiveResourceInjection.
@Test
public void primitiveResourceInjection() {
ApplicationContext ctx = new StandardApplicationContext(Config.class, ResourceComponent.class);
assertThat(ctx.getBean(ResourceComponent.class).b).isEqualTo(true);
assertThat(ctx.getBean(ResourceComponent.class).i).isEqualTo(42);
}
Aggregations