Java 类org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConditionEvaluationReportTests.java   
@Test
public void duplicateOutcomes() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            DuplicateConfig.class);
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(context.getBeanFactory());
    String autoconfigKey = MultipartAutoConfiguration.class.getName();

    ConditionAndOutcomes outcomes = report.getConditionAndOutcomesBySource()
            .get(autoconfigKey);
    assertThat(outcomes).isNotEqualTo(nullValue());
    assertThat(getNumberOfOutcomes(outcomes)).isEqualTo(2);

    List<String> messages = new ArrayList<String>();
    for (ConditionAndOutcome outcome : outcomes) {
        messages.add(outcome.getOutcome().getMessage());
    }
    assertThat(messages).areAtLeastOne(Matched.by(
            containsString("@ConditionalOnClass classes found: javax.servlet.Servlet,"
                    + "org.springframework.web.multipart.support.StandardServletMultipartResolver")));
    context.close();
}
项目:spring-boot-concourse    文件:ConditionEvaluationReportTests.java   
@Test
public void duplicateOutcomes() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            DuplicateConfig.class);
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(context.getBeanFactory());
    String autoconfigKey = MultipartAutoConfiguration.class.getName();

    ConditionAndOutcomes outcomes = report.getConditionAndOutcomesBySource()
            .get(autoconfigKey);
    assertThat(outcomes).isNotEqualTo(nullValue());
    assertThat(getNumberOfOutcomes(outcomes)).isEqualTo(2);

    List<String> messages = new ArrayList<String>();
    for (ConditionAndOutcome outcome : outcomes) {
        messages.add(outcome.getOutcome().getMessage());
    }
    assertThat(messages).areAtLeastOne(Matched.by(
            containsString("@ConditionalOnClass classes found: javax.servlet.Servlet,"
                    + "org.springframework.web.multipart.support.StandardServletMultipartResolver")));
    context.close();
}
项目:contestparser    文件:ConditionEvaluationReportTests.java   
@Test
public void duplicateOutcomes() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            DuplicateConfig.class);
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(context.getBeanFactory());
    String autoconfigKey = MultipartAutoConfiguration.class.getName();

    ConditionAndOutcomes outcomes = report.getConditionAndOutcomesBySource()
            .get(autoconfigKey);
    assertThat(outcomes, not(nullValue()));
    assertThat(getNumberOfOutcomes(outcomes), equalTo(2));

    List<String> messages = new ArrayList<String>();
    for (ConditionAndOutcome outcome : outcomes) {
        messages.add(outcome.getOutcome().getMessage());
    }

    Matcher<String> onClassMessage = containsString("@ConditionalOnClass "
            + "classes found: javax.servlet.Servlet,org.springframework.web.multipart.support.StandardServletMultipartResolver");
    assertThat(messages, hasItem(onClassMessage));
    context.close();
}