Search in sources :

Example 6 with EzyHttpApplication

use of com.tvd12.ezyhttp.server.core.EzyHttpApplication in project ezyhttp by youngmonkeys.

the class EzyHttpApplicationTest method testFailedDueToNoApplicationEntry.

@Test
public void testFailedDueToNoApplicationEntry() {
    // given
    ApplicationContext context = mock(ApplicationContext.class);
    EzyHttpApplication sut = new EzyHttpApplication(context);
    // when
    Throwable e = Asserts.assertThrows(sut::start);
    // then
    Asserts.assertThat(e).isEqualsType(IllegalStateException.class);
    verify(context, times(1)).getAnnotatedSingleton(ApplicationBootstrap.class);
}
Also used : ApplicationContext(com.tvd12.ezyhttp.server.core.ApplicationContext) EzyHttpApplication(com.tvd12.ezyhttp.server.core.EzyHttpApplication) Test(org.testng.annotations.Test)

Aggregations

EzyHttpApplication (com.tvd12.ezyhttp.server.core.EzyHttpApplication)6 Test (org.testng.annotations.Test)6 ApplicationContext (com.tvd12.ezyhttp.server.core.ApplicationContext)4 EzyBeanContext (com.tvd12.ezyfox.bean.EzyBeanContext)3 ResourceDownloadManager (com.tvd12.ezyhttp.core.resources.ResourceDownloadManager)2 ResourceResolver (com.tvd12.ezyhttp.server.core.resources.ResourceResolver)2 UserService (com.tvd12.ezyhttp.server.core.test.service.UserService)2 ViewContextBuilder (com.tvd12.ezyhttp.server.core.view.ViewContextBuilder)2