use of org.talend.sdk.component.junit.http.internal.impl.DefaultResponseLocator in project component-runtime by Talend.
the class JUnit4HttpApiPerMethodConfigurator method apply.
@Override
public Statement apply(final Statement base, final Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
final ResponseLocator responseLocator = server.getResponseLocator();
if (DefaultResponseLocator.class.isInstance(responseLocator)) {
final DefaultResponseLocator defaultResponseLocator = DefaultResponseLocator.class.cast(responseLocator);
defaultResponseLocator.setTest(description.getClassName() + "_" + description.getMethodName());
}
try {
base.evaluate();
} finally {
if (DefaultResponseLocator.class.isInstance(responseLocator)) {
if (Handlers.isActive("capture")) {
final DefaultResponseLocator defaultResponseLocator = DefaultResponseLocator.class.cast(responseLocator);
defaultResponseLocator.flush(Handlers.getBaseCapture());
}
}
}
}
};
}
Aggregations