@Test public void getNonMuleExceptionCause() { assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), null)), nullValue()); assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), new ConfigurationException(failedToBuildMessage(), null))), nullValue()); assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), new ConfigurationException(failedToBuildMessage(), new IllegalArgumentException()))), instanceOf(IllegalArgumentException.class)); assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), new ConfigurationException(failedToBuildMessage(), new IllegalArgumentException(new NullPointerException())))), instanceOf(IllegalArgumentException.class)); assertThat(getNonMuleException(new IllegalArgumentException()), instanceOf(IllegalArgumentException.class)); }
@Test public void getNonMuleExceptionCause() { assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), null)), nullValue()); assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), new ConfigurationException(failedToBuildMessage(), null))), nullValue()); assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), new ConfigurationException(failedToBuildMessage(), new IllegalArgumentException()))), instanceOf(IllegalArgumentException.class)); assertThat(getNonMuleException(new ResolverException(failedToBuildMessage(), new ConfigurationException(failedToBuildMessage(), new IllegalArgumentException(new NullPointerException())))), instanceOf(IllegalArgumentException.class)); assertThat(getNonMuleException(new IllegalArgumentException()), instanceOf(IllegalArgumentException.class)); }