Source:
public void exceptionDuringClientReceive() throws Exception { WebTarget base = client.target(generateURL("/get/ok")); Response response = base.request().get(); LogCounter errorStringLog = new LogCounter("ERROR", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); LogCounter resteasyExceptionLog = new LogCounter( ".*ERROR .* RESTEASY004672.*", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER, true); LogCounter yassonExceptionLog = new LogCounter( "Caused by: javax.json.bind.JsonbException", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); LogCounter yassonStacktraceLog = new LogCounter("at org.eclipse.yasson", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); LogCounter applicationExcpetionLog = new LogCounter( "Caused by: java.lang.RuntimeException: " + JsonBindingDebugLoggingItemCorruptedSet.class.getSimpleName(), true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); try { response.readEntity(JsonBindingDebugLoggingItemCorruptedSet.class); Assert.fail("Client doesn't throw Exception during reading of corrupted data"); } catch (ProcessingException e) { StringWriter errors = new StringWriter(); e.printStackTrace(new PrintWriter(errors)); String stackTrace = errors.toString(); Assert.assertThat("Stracktrace doesn't contain javax.json.bind.JsonbException", stackTrace, containsString("javax.json.bind.JsonbException")); Assert.assertThat("Stracktrace doesn't contain yasson part", stackTrace, containsString("org.eclipse.yasson.internal")); Assert.assertThat("Stracktrace doesn't contain application exception", stackTrace, containsString("Caused by: java.lang.RuntimeException: " + JsonBindingDebugLoggingItemCorruptedSet.class.getSimpleName())); } Assert.assertThat("Application Exception should be logged", applicationExcpetionLog.count(), is(1)); Assert.assertThat("Yasson exception should be logged", yassonExceptionLog.count(), is(1)); Assert.assertThat("There should be no Yasson exception stacktrace logged", yassonStacktraceLog.count(), greaterThan(0)); }

Target:
public void exceptionDuringClientReceive() throws Exception { WebTarget base = client.target(generateURL("/get/ok")); Response response = base.request().get(); LogCounter errorStringLog = new LogCounter("ERROR", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); LogCounter resteasyExceptionLog = new LogCounter( ".*DEBUG .* RESTEASY002340.*", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER, true); LogCounter yassonExceptionLog = new LogCounter( "Caused by: javax.json.bind.JsonbException", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); LogCounter yassonStacktraceLog = new LogCounter("at org.eclipse.yasson", true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); LogCounter applicationExcpetionLog = new LogCounter( "Caused by: java.lang.RuntimeException: " + JsonBindingDebugLoggingItemCorruptedSet.class.getSimpleName(), true, ContainerConstants.DEFAULT_CONTAINER_QUALIFIER); try { response.readEntity(JsonBindingDebugLoggingItemCorruptedSet.class); Assert.fail("Client doesn't throw Exception during reading of corrupted data"); } catch (ProcessingException e) { StringWriter errors = new StringWriter(); e.printStackTrace(new PrintWriter(errors)); String stackTrace = errors.toString(); Assert.assertThat("Stracktrace doesn't contain javax.json.bind.JsonbException", stackTrace, containsString("javax.json.bind.JsonbException")); Assert.assertThat("Stracktrace doesn't contain yasson part", stackTrace, containsString("org.eclipse.yasson.internal")); Assert.assertThat("Stracktrace doesn't contain application exception", stackTrace, containsString("Caused by: java.lang.RuntimeException: " + JsonBindingDebugLoggingItemCorruptedSet.class.getSimpleName())); } Assert.assertThat("Application Exception should be logged", applicationExcpetionLog.count(), is(1)); Assert.assertThat("RESTEasy exception should be logged", resteasyExceptionLog.count(), is(1)); Assert.assertThat("Yasson exception should be logged", yassonExceptionLog.count(), is(1)); Assert.assertThat("Yasson exception stacktrace should be logged", yassonStacktraceLog.count(), greaterThan(0)); Assert.assertThat("There shouldn't be any error logs in client", errorStringLog.count(), is(0)); }