
net.serenitybdd.junit.finder.TestMethodFinder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of serenity-junit Show documentation
Show all versions of serenity-junit Show documentation
Serenity JUnit integration
package net.serenitybdd.junit.finder;
import ch.lambdaj.function.matcher.Predicate;
import org.hamcrest.Matcher;
import java.lang.reflect.Method;
import java.util.List;
import static ch.lambdaj.Lambda.filter;
public class TestMethodFinder {
private final TestFinder testFinder;
public TestMethodFinder(TestFinder testFinder) {
this.testFinder = testFinder;
}
public List withNameContaining(String partialName) {
return filter(methodsWithPartialName(partialName), testFinder.getAllTestMethods());
}
Matcher methodsWithPartialName(final String partialName) {
return new Predicate() {
public boolean apply(Method testMethod) {
return testMethod.getName().contains(partialName);
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy