public void reset(@Observes final AfterClass ignored) {
CURRENT.remove();
}
public static void matched(final StepDefinitionMatch match) {
final TestEvent event;
try {
final Field field = StepDefinitionMatch.class.getDeclaredField("stepDefinition");
if (!field.isAccessible()) {
field.setAccessible(true);
}
final StepDefinition stepDefinition = StepDefinition.class.cast(field.get(match));
if (ArquillianStepDefinition.class.isInstance(stepDefinition)) {
final ArquillianStepDefinition arquillianStepDefinition = ArquillianStepDefinition.class.cast(stepDefinition);
event = new TestEvent(arquillianStepDefinition.getInstance(), arquillianStepDefinition.getMethod());
} else {
throw new IllegalStateException("Can't find ArquillianStepDefinition");
}
} catch (final Exception e) {
throw new IllegalStateException(e);