de.tum.in.test.api.jupiter.JupiterContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of artemis-java-test-sandbox Show documentation
Show all versions of artemis-java-test-sandbox Show documentation
The Artemis Java Test Sandbox. A JUnit 5 Extension for secure Artemis Java Testing.
package de.tum.in.test.api.jupiter;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
import org.junit.jupiter.api.extension.ExtensionContext;
import de.tum.in.test.api.internal.TestContext;
import de.tum.in.test.api.internal.TestContextUtils;
import de.tum.in.test.api.internal.TestType;
@API(status = Status.INTERNAL)
public class JupiterContext extends TestContext {
private final ExtensionContext extensionContext;
JupiterContext(ExtensionContext extensionContext) {
this.extensionContext = extensionContext;
}
@Override
public Optional testMethod() {
return findOptionalsInHierarchy(ExtensionContext::getTestMethod).findFirst();
}
@Override
public Optional> testClass() {
return findOptionalsInHierarchy(ExtensionContext::getTestClass).findFirst();
}
@Override
public Optional