package org.junit.jupiter.engine.descriptor;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.engine.config.JupiterConfiguration;
import org.junit.jupiter.engine.execution.JupiterEngineExecutionContext;
import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.engine.TestSource;
import org.junit.platform.engine.UniqueId;
class DynamicTestTestDescriptor extends DynamicNodeTestDescriptor {
private final DynamicTest dynamicTest;
DynamicTestTestDescriptor(UniqueId uniqueId, int index, DynamicTest dynamicTest, TestSource source,
JupiterConfiguration configuration) {
super(uniqueId, index, dynamicTest, source, configuration);
this.dynamicTest = dynamicTest;
}
@Override
public Type getType() {
return Type.TEST;
}
@Override
public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context,
DynamicTestExecutor dynamicTestExecutor) throws Exception {
executeAndMaskThrowable(dynamicTest.getExecutable());
return context;
}
}