use of org.apache.deltaspike.test.core.impl.exception.control.extension.literal.CatchQualifierLiteral in project deltaspike by apache.
the class HandlerComparatorTest method assertOrderIsCorrectWithQualifiers.
@Test
public void assertOrderIsCorrectWithQualifiers() {
Set<Annotation> qualifiers = new HashSet<Annotation>();
qualifiers.add(new CatchQualifierLiteral());
List<HandlerMethod<? extends Throwable>> handlers = new ArrayList<HandlerMethod<? extends Throwable>>(storage.getHandlersForException(NullPointerException.class, bm, qualifiers, false));
assertThat(handlers.size(), is(6));
assertThat(((HandlerMethodImpl<?>) handlers.get(0)).getJavaMethod().getName(), is("catchThrowable"));
assertThat(((HandlerMethodImpl<?>) handlers.get(1)).getJavaMethod().getName(), is("catchThrowableP20"));
assertThat(((HandlerMethodImpl<?>) handlers.get(2)).getJavaMethod().getName(), is("qualifiedHandler"));
assertThat(((HandlerMethodImpl<?>) handlers.get(3)).getJavaMethod().getName(), is("catchRuntime"));
assertThat(((HandlerMethodImpl<?>) handlers.get(4)).getJavaMethod().getName(), is("npeHandlerNoDefQualifier"));
assertThat(((HandlerMethodImpl<?>) handlers.get(5)).getJavaMethod().getName(), is("npeHandlerDefQualifier"));
}
Aggregations