Search in sources :

Example 1 with ServletWebServerApplicationContext

use of cn.taketoday.framework.web.servlet.context.ServletWebServerApplicationContext in project today-infrastructure by TAKETODAY.

the class MissingWebServerFactoryBeanFailureAnalyzerTests method missingServletWebServerFactoryBeanFailure.

@Test
void missingServletWebServerFactoryBeanFailure() {
    ApplicationContextException failure = createFailure(new ServletWebServerApplicationContext());
    assertThat(failure).isNotNull();
    FailureAnalysis analysis = new MissingWebServerFactoryBeanFailureAnalyzer().analyze(failure);
    assertThat(analysis).isNotNull();
    assertThat(analysis.getDescription()).isEqualTo("Web application could not be started as there was no " + ServletWebServerFactory.class.getName() + " bean defined in the context.");
    assertThat(analysis.getAction()).isEqualTo("Check your application's dependencies for a supported servlet_web web server.\nCheck the configured web " + "application type.");
}
Also used : ServletWebServerFactory(cn.taketoday.framework.web.servlet.server.ServletWebServerFactory) ServletWebServerApplicationContext(cn.taketoday.framework.web.servlet.context.ServletWebServerApplicationContext) FailureAnalysis(cn.taketoday.framework.diagnostics.FailureAnalysis) ApplicationContextException(cn.taketoday.context.ApplicationContextException) Test(org.junit.jupiter.api.Test)

Example 2 with ServletWebServerApplicationContext

use of cn.taketoday.framework.web.servlet.context.ServletWebServerApplicationContext in project today-framework by TAKETODAY.

the class MissingWebServerFactoryBeanFailureAnalyzerTests method missingServletWebServerFactoryBeanFailure.

@Test
void missingServletWebServerFactoryBeanFailure() {
    ApplicationContextException failure = createFailure(new ServletWebServerApplicationContext());
    assertThat(failure).isNotNull();
    FailureAnalysis analysis = new MissingWebServerFactoryBeanFailureAnalyzer().analyze(failure);
    assertThat(analysis).isNotNull();
    assertThat(analysis.getDescription()).isEqualTo("Web application could not be started as there was no " + ServletWebServerFactory.class.getName() + " bean defined in the context.");
    assertThat(analysis.getAction()).isEqualTo("Check your application's dependencies for a supported servlet_web web server.\nCheck the configured web " + "application type.");
}
Also used : ServletWebServerFactory(cn.taketoday.framework.web.servlet.server.ServletWebServerFactory) ServletWebServerApplicationContext(cn.taketoday.framework.web.servlet.context.ServletWebServerApplicationContext) FailureAnalysis(cn.taketoday.framework.diagnostics.FailureAnalysis) ApplicationContextException(cn.taketoday.context.ApplicationContextException) Test(org.junit.jupiter.api.Test)

Aggregations

ApplicationContextException (cn.taketoday.context.ApplicationContextException)2 FailureAnalysis (cn.taketoday.framework.diagnostics.FailureAnalysis)2 ServletWebServerApplicationContext (cn.taketoday.framework.web.servlet.context.ServletWebServerApplicationContext)2 ServletWebServerFactory (cn.taketoday.framework.web.servlet.server.ServletWebServerFactory)2 Test (org.junit.jupiter.api.Test)2