TestContext context = mock(TestContext.class);
final Execution execution = mock(Execution.class);
when(context.introspector()).thenReturn(introspector);
when(execution.context()).thenReturn(context);
when(execution.step()).thenReturn(Step.BEFORE);
when(execution.method()).thenReturn(getClass().getDeclaredMethod("test_execution"));
assertThrow(IllegalStateException.class).containingMessage("No Execution context bound to local thread !").whenRunning(new Code() {
public void run() throws Throwable {
Mycila.currentExecution();
}