Class DeclaredMethodSelector

java.lang.Object
org.junit.jupiter.engine.discovery.DeclaredMethodSelector
All Implemented Interfaces:
DiscoverySelector

final class DeclaredMethodSelector extends Object implements DiscoverySelector
Jupiter-specific selector for methods, potentially in nested classes.

The important difference to MethodSelector is that this selector's equals(Object) method takes into account the selected method's declaring class to support cases where a package-private method is declared in a super class in a different package and a method with the same signature is declared in a subclass. In that case both methods should be discovered because the one declared in the subclass does not override the one in the super class.

Since:
5.14.1
  • Field Details

    • testClasses

      private final List<Class<?>> testClasses
    • method

      private final Method method
  • Constructor Details

    • DeclaredMethodSelector

      DeclaredMethodSelector(List<Class<?>> testClasses, Method method)
  • Method Details