fr.vergne.pester.junit.extension.DefinitionCasesProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pester-core Show documentation
Show all versions of pester-core Show documentation
Implementation of the Pester library.
The newest version!
package fr.vergne.pester.junit.extension;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Stream;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.ArgumentsProvider;
import org.junit.platform.commons.support.AnnotationSupport;
import fr.vergne.pester.PesterTest;
import fr.vergne.pester.definition.PojoDefinition;
import fr.vergne.pester.junit.TestCasesGenerator;
import fr.vergne.pester.junit.TestParameter;
import fr.vergne.pester.junit.annotation.DefinitionSource;
import fr.vergne.pester.util.cache.Cache;
import fr.vergne.pester.util.cache.Key;
import fr.vergne.pester.util.cache.ParameteredKey;
public class DefinitionCasesProvider implements ArgumentsProvider {
public static final Key> PARAMETERIZED_TEST_CASES = ParameteredKey.create(new Object());
@Override
public Stream provideArguments(ExtensionContext context) throws Exception {
Cache cache = new ExtensionCache(context).getTestCache(context.getUniqueId());
List