@Test public void unpackAll() { NullPointerException childException = new NullPointerException("Hello World!"); RuntimeException parentException = new RuntimeException("Hello Heaven!", childException); ThrowableFilter filter = new UnpackThrowableFilter(); ThrowableData data = filter.filter(new ThrowableWrapper(parentException)); assertThat(data.getClassName()).isEqualTo(NullPointerException.class.getName()); assertThat(data.getMessage()).isEqualTo("Hello World!"); assertThat(data.getStackTrace()).containsExactly(childException.getStackTrace()); assertThat(data.getCause()).isNull(); }
@Override public ThrowableData filter(final ThrowableData origin) { ThrowableData cause = origin.getCause(); if (cause != null) { List<String> classNames = getArguments(); if (classNames.isEmpty()) { return filter(cause); } for (String className : classNames) { if (className.equals(origin.getClassName())) { return filter(cause); } } } return origin; }
UnpackThrowableFilter extends AbstractThrowableFilter { @Override public ThrowableData filter(final ThrowableData origin) { ThrowableData cause = origin.getCause(); if (cause != null) { List<String> classNames = getArguments(); if (classNames.isEmpty()) { return filter(cause); } for (String className : classNames) { if (className.equals(origin.getClassName())) { return filter(cause); } } } return origin; } }
UnpackThrowableFilter extends AbstractThrowableFilter { @Override public ThrowableData filter(final ThrowableData origin) { ThrowableData cause = origin.getCause(); if (cause != null) { List<String> classNames = getArguments(); if (classNames.isEmpty()) { return filter(cause); } for (String className : classNames) { if (className.equals(origin.getClassName())) { return filter(cause); } } } return origin; } UnpackThrowableFilter();  UnpackThrowableFilter(final String arguments); }
UnpackThrowableFilter extends AbstractThrowableFilter { @Override public ThrowableData filter(final ThrowableData origin) { ThrowableData cause = origin.getCause(); if (cause != null) { List<String> classNames = getArguments(); if (classNames.isEmpty()) { return filter(cause); } for (String className : classNames) { if (className.equals(origin.getClassName())) { return filter(cause); } } } return origin; } UnpackThrowableFilter();  UnpackThrowableFilter(final String arguments); @Override ThrowableData filter(final ThrowableData origin); }
UnpackThrowableFilter extends AbstractThrowableFilter { @Override public ThrowableData filter(final ThrowableData origin) { ThrowableData cause = origin.getCause(); if (cause != null) { List<String> classNames = getArguments(); if (classNames.isEmpty()) { return filter(cause); } for (String className : classNames) { if (className.equals(origin.getClassName())) { return filter(cause); } } } return origin; } UnpackThrowableFilter();  UnpackThrowableFilter(final String arguments); @Override ThrowableData filter(final ThrowableData origin);  }