@API(status=STABLE, since="1.0") public class MethodSource extends Object implements TestSource
TestSource
.
This class stores the method name along with the names of its parameter
types because Method
does not implement Serializable
.
MethodSelector
,
Serialized FormModifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static MethodSource |
from(Class<?> testClass,
Method testMethod)
|
static MethodSource |
from(Method testMethod)
Create a new
MethodSource using the supplied method . |
static MethodSource |
from(String className,
String methodName)
Create a new
MethodSource using the supplied class name and
method name. |
static MethodSource |
from(String className,
String methodName,
String methodParameterTypes)
Create a new
MethodSource using the supplied class name, method
name, and method parameter types. |
String |
getClassName()
Get the class name of this source.
|
String |
getMethodName()
Get the method name of this source.
|
String |
getMethodParameterTypes()
Get the method parameter types of this source.
|
int |
hashCode() |
String |
toString() |
public static MethodSource from(String className, String methodName)
MethodSource
using the supplied class name and
method name.className
- the class name; must not be null
or blankmethodName
- the method name; must not be null
or blankpublic static MethodSource from(String className, String methodName, String methodParameterTypes)
MethodSource
using the supplied class name, method
name, and method parameter types.className
- the class name; must not be null
or blankmethodName
- the method name; must not be null
or blankmethodParameterTypes
- the method parameter types as a stringpublic static MethodSource from(Method testMethod)
MethodSource
using the supplied method
.testMethod
- the Java method; must not be null
from(Class, Method)
@API(status=STABLE, since="1.3") public static MethodSource from(Class<?> testClass, Method testMethod)
MethodSource
using the supplied
class
and method
.
This method should be used in favor of from(Method)
if the
test method is inherited from a superclass or present as an interface
default
method.
testClass
- the Java class; must not be null
testMethod
- the Java method; must not be null
public String getClassName()
public final String getMethodName()
public final String getMethodParameterTypes()
Copyright © 2022. All rights reserved.