@Override
protected Statement methodBlock(FrameworkMethod method) {
TestClass testClass = getTestClass();
Class<?> javaClass = testClass.getJavaClass();
try {
Object testInstance = createTest();
TestContext testContext = getTestContext(javaClass);
testContext.setTestInstance(testInstance);
UnitTestReifier reifier = new UnitTestReifier(testInstance);
UnitTestCreator creator = new UnitTestCreator(testContext, reifier);
creator.create();
UnitTestVerifier verifier = new UnitTestVerifier(testContext, LOGGER);
verifier.wiring();
Statement statement = methodInvoker(method, testInstance);
statement = possiblyExpectingExceptions(method, testInstance, statement);
statement = withBefores(method, testInstance, statement);
statement = withAfters(method, testInstance, statement);
statement = withRules(method, testInstance, statement);
return statement;
} catch (Exception e) {
throw new IllegalStateException(e);
}
}