Example usage for org.springframework.context.annotation AnnotationConfigApplicationContext getBeanNamesForType

List of usage examples for org.springframework.context.annotation AnnotationConfigApplicationContext getBeanNamesForType

Introduction

In this page you can find the example usage for org.springframework.context.annotation AnnotationConfigApplicationContext getBeanNamesForType.

Prototype

@Override
    public String[] getBeanNamesForType(ResolvableType type) 

Source Link

Usage

From source file:com.domingosuarez.boot.autoconfigure.jade4j.Jade4JAutoConfigurationTests.java

@Test
@Ignore//  w ww. j  a va  2 s .  c  om
public void renderNonWebAppTemplate() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            Jade4JAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
    assertEquals(0, context.getBeanNamesForType(ViewResolver.class).length);
    try {
        JadeConfiguration engine = this.context.getBean(JadeConfiguration.class);
        JadeTemplate template = engine.getTemplate("demo.jade");
        Map<String, Object> params = params();
        String result = engine.renderTemplate(template, params);

        assertThat(result, containsString("With user"));
    } finally {
        context.close();
    }
}