Search in sources :

Example 1 with CdiTestExceptionMapper

use of io.crnk.internal.boot.cdi.model.CdiTestExceptionMapper in project crnk-framework by crnk-project.

the class CdiServiceDiscoveryTest method testExceptionMapper.

@Test
public void testExceptionMapper() {
    CrnkBoot boot = new CrnkBoot();
    boot.boot();
    Optional<JsonApiExceptionMapper> mapper = boot.getExceptionMapperRegistry().findMapperFor(IllegalStateException.class);
    Assert.assertTrue(mapper.isPresent());
    Assert.assertTrue(mapper.get() instanceof CdiTestExceptionMapper);
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) CdiTestExceptionMapper(io.crnk.internal.boot.cdi.model.CdiTestExceptionMapper) JsonApiExceptionMapper(io.crnk.core.engine.error.JsonApiExceptionMapper) Test(org.junit.Test)

Aggregations

CrnkBoot (io.crnk.core.boot.CrnkBoot)1 JsonApiExceptionMapper (io.crnk.core.engine.error.JsonApiExceptionMapper)1 CdiTestExceptionMapper (io.crnk.internal.boot.cdi.model.CdiTestExceptionMapper)1 Test (org.junit.Test)1