All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.bechte.junit.runners.context.description.MethodDescriber Maven / Gradle / Ivy

Go to download

This is a runner implementation that supports context hierarchies in JUnit. For more details please visit: https://github.com/bechte/junit-hierarchicalcontextrunner/wiki

There is a newer version: 4.12.2
Show newest version
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