use of io.crnk.operations.server.OperationFilterContext in project crnk-framework by crnk-project.
the class OperationsExceptionTest method testUnknownErrorTriggerInternalError.
@Test
public void testUnknownErrorTriggerInternalError() {
operationsModule.addFilter(new OperationFilter() {
@Override
public List<OperationResponse> filter(OperationFilterContext context, OperationFilterChain chain) {
throw new IllegalStateException("test");
}
});
MovieEntity movie1 = newMovie("1");
MovieEntity movie2 = newMovie("2");
OperationsCall insertCall = operationsClient.createCall();
insertCall.add(HttpMethod.POST, movie1);
insertCall.add(HttpMethod.POST, movie2);
try {
insertCall.execute();
Assert.fail();
} catch (InternalServerErrorException e) {
// ok
}
}
Aggregations