fr.vergne.pester.junit.extension.TestSpecificity 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.Comparator;
import org.junit.jupiter.api.MethodDescriptor;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.MethodOrdererContext;
import fr.vergne.pester.junit.PesterTestComparator;
public class TestSpecificity implements MethodOrderer {
private final Comparator descriptorComparator = Comparator.comparing(MethodDescriptor::getMethod,
new PesterTestComparator());
@Override
public void orderMethods(MethodOrdererContext context) {
context.getMethodDescriptors().sort(descriptorComparator);
}
}