use of org.mule.runtime.core.api.exception.ErrorTypeMatcher in project mule by mulesoft.
the class SingleErrorTypeMatcherTestCase method matchEqual.
@Test
public void matchEqual() {
ErrorTypeMatcher transformationMatcher = new SingleErrorTypeMatcher(transformationErrorType);
assertThat(transformationMatcher.match(transformationErrorType), is(true));
}
use of org.mule.runtime.core.api.exception.ErrorTypeMatcher in project mule by mulesoft.
the class SingleErrorTypeMatcherTestCase method anyMatchsAll.
@Test
public void anyMatchsAll() {
ErrorType mockErrorType = mock(ErrorType.class);
when(mockErrorType.getParentErrorType()).thenReturn(transformationErrorType);
ErrorTypeMatcher anyMatcher = new SingleErrorTypeMatcher(anyErrorType);
assertThat(anyMatcher.match(anyErrorType), is(true));
assertThat(anyMatcher.match(transformationErrorType), is(true));
assertThat(anyMatcher.match(expressionErrorType), is(true));
assertThat(anyMatcher.match(mockErrorType), is(true));
}
use of org.mule.runtime.core.api.exception.ErrorTypeMatcher in project mule by mulesoft.
the class SingleErrorTypeMatcherTestCase method doesNotMatchSibling.
@Test
public void doesNotMatchSibling() {
ErrorTypeMatcher transformationMatcher = new SingleErrorTypeMatcher(transformationErrorType);
assertThat(transformationMatcher.match(expressionErrorType), is(false));
}
use of org.mule.runtime.core.api.exception.ErrorTypeMatcher in project mule by mulesoft.
the class DisjunctiveErrorTypeMatcherTestCase method allMatch.
@Test
public void allMatch() {
ErrorType mockErrorType = mock(ErrorType.class);
when(mockErrorType.getParentErrorType()).thenReturn(transformationErrorType);
ErrorTypeMatcher matcherWithTwoTransformation = createMatcher(transformationErrorType, mockErrorType);
assertThat(matcherWithTwoTransformation.match(mockErrorType), is(true));
}
use of org.mule.runtime.core.api.exception.ErrorTypeMatcher in project mule by mulesoft.
the class SingleErrorTypeMatcherTestCase method doesNotMatchParent.
@Test
public void doesNotMatchParent() {
ErrorTypeMatcher transformationMatcher = new SingleErrorTypeMatcher(transformationErrorType);
assertThat(transformationMatcher.match(anyErrorType), is(false));
}
Aggregations