
de.bechte.junit.runners.context.description.MethodDescriber Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit-hierarchicalcontextrunner Show documentation
Show all versions of junit-hierarchicalcontextrunner Show documentation
This is a runner implementation that supports context hierarchies in JUnit. For more
details please visit: https://github.com/bechte/junit-hierarchicalcontextrunner/wiki
package de.bechte.junit.runners.context.description;
import org.junit.runner.Description;
import org.junit.runners.model.FrameworkMethod;
import java.lang.annotation.Annotation;
/**
* The {@link MethodDescriber} is responsible for creating the {@link Description} for a {@link FrameworkMethod}.
*/
public class MethodDescriber implements Describer {
@Override
public Description describe(final FrameworkMethod method) {
if (method == null)
throw new IllegalArgumentException("Method must not be null!");
final Class> declaringClass = method.getMethod().getDeclaringClass();
final String methodName = method.getName();
final Annotation[] annotations = method.getAnnotations();
return Description.createTestDescription(declaringClass, methodName, annotations);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy