Search in sources :

Example 1 with TestExceptionMapper

use of io.crnk.test.mock.TestExceptionMapper in project crnk-framework by crnk-project.

the class GuiceServiceDiscoveryTest method exceptionMapperDiscovery.

@Test
public void exceptionMapperDiscovery() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceDiscovery(discovery);
    boot.boot();
    Optional<JsonApiExceptionMapper> mapper = boot.getExceptionMapperRegistry().findMapperFor(TestException.class);
    Assert.assertTrue(mapper.isPresent());
    Assert.assertTrue(mapper.get() instanceof TestExceptionMapper);
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) JsonApiExceptionMapper(io.crnk.core.engine.error.JsonApiExceptionMapper) TestExceptionMapper(io.crnk.test.mock.TestExceptionMapper) Test(org.junit.Test)

Aggregations

CrnkBoot (io.crnk.core.boot.CrnkBoot)1 JsonApiExceptionMapper (io.crnk.core.engine.error.JsonApiExceptionMapper)1 TestExceptionMapper (io.crnk.test.mock.TestExceptionMapper)1 Test (org.junit.Test)1