Skip to content

Commit

Permalink
- r use querable
Browse files Browse the repository at this point in the history
Co-Authored-By: Jay Bazuzi <jay@bazuzi.com>
  • Loading branch information
isidore and JayBazuzi committed Mar 10, 2025
1 parent 9f8b9b6 commit db3dd86
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,16 @@ private boolean isJunit3Test(Class<?> clazz)
private boolean isTestAttribute(Class<?> clazz, String methodName)
{
Queryable<Method> methods = getMethodsByName(clazz, methodName);
for (Method method : methods)
{
for (Class<? extends Annotation> attribute : attributes)
{
if (method.isAnnotationPresent(attribute))
{
checkConditionsForAttribute(attribute);
return true;
}
}
}
return false;
Class<? extends Annotation> attribute = Queryable.as(attributes) //
.first(a -> methods.any(m -> m.isAnnotationPresent(a)));
checkConditionsForAttribute(attribute);
return attribute != null;
}
// TODO: clean this up, should be pluggable
private static void checkConditionsForAttribute(Class<? extends Annotation> attribute)
{
if (attribute == null)
{ return; }
if ("org.junit.jupiter.api.TestFactory".equals(attribute.getName()))
{
if (!isDynamicWrapperPresent())
Expand Down

0 comments on commit db3dd86

Please sign in to comment.