NinjaDefault implements Ninja { @Override public void renderErrorResultAndCatchAndLogExceptions( Result result, Context context) { try { if (context.isAsync()) { context.returnResultAsync(result); } else { resultHandler.handleResult(result, context); } } catch (Exception exceptionCausingRenderError) { logger.error("Unable to handle result. That's really really fishy.", exceptionCausingRenderError); } }  boolean isDiagnosticsEnabled(); @Override void onRouteRequest(Context.Impl context); @Override void renderErrorResultAndCatchAndLogExceptions(
            Result result, Context context); @Override void onFrameworkStart(); @Override void onFrameworkShutdown(); @Override Result onException(Context context, Exception exception); Result onException(Context context, Exception exception, Result underlyingResult); Result getRenderingExceptionResult(Context context, RenderingException exception, Result underlyingResult); @Deprecated Result getInternalServerErrorResult(Context context, Exception exception); @Override Result getInternalServerErrorResult(Context context, Exception exception, Result underlyingResult); @Override Result getNotFoundResult(Context context); @Override Result getNotFoundResult(Context context, RequestNotFoundException exception); @Override Result getBadRequestResult(Context context, BadRequestException exception); @Override Result getUnauthorizedResult(Context context); @Override Result getForbiddenResult(Context context); @Override Result getForbiddenResult(Context context, ForbiddenRequestException exception);  }
@Test public void testRenderErrorResultAndCatchAndLogExceptionsAsync() { Mockito.when(contextImpl.isAsync()).thenReturn(true); ninjaDefault.renderErrorResultAndCatchAndLogExceptions(result, contextImpl); verify(contextImpl).isAsync(); verify(contextImpl).returnResultAsync(result); }
@Test public void testRenderErrorResultAndCatchAndLogExceptionsSync() { Mockito.when(contextImpl.isAsync()).thenReturn(false); ninjaDefault.renderErrorResultAndCatchAndLogExceptions(result, contextImpl); verify(resultHandler).handleResult(result, contextImpl); }