Skip to content

Commit

Permalink
- r moving to 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 21eecfb commit 9f8b9b6
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ private boolean isJunit3Test(Class<?> clazz)
}
private boolean isTestAttribute(Class<?> clazz, String methodName)
{
List<Method> methods = getMethodsByName(clazz, methodName);
if (methods.isEmpty())
{ return false; }
Queryable<Method> methods = getMethodsByName(clazz, methodName);
for (Method method : methods)
{
for (Class<? extends Annotation> attribute : attributes)
Expand Down Expand Up @@ -147,16 +145,16 @@ private static boolean isDynamicWrapperPresent()
.any(stackTraceElement -> "org.approvaltests.integrations.junit5.JupiterApprovals"
.equals(stackTraceElement.getClassName()));
}
public static List<Method> getMethodsByName(Class<?> clazz, String methodName)
public static Queryable<Method> getMethodsByName(Class<?> clazz, String methodName)
{
try
{
return Arrays.stream(clazz.getDeclaredMethods()).filter(m -> m.getName().equals(methodName))
.collect(Collectors.toList());
return Queryable.of(clazz.getDeclaredMethods()) //
.where(m -> m.getName().equals(methodName));
}
catch (Throwable e)
{
return new ArrayList<>();
return new Queryable<>();
}
}
@Override
Expand Down

0 comments on commit 9f8b9b6

Please sign in to comment.