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

net.serenitybdd.junit.runners.TestMethodConfiguration Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package net.serenitybdd.junit.runners;

import net.serenitybdd.annotations.Manual;
import net.serenitybdd.annotations.Pending;
import net.thucydides.model.domain.TestResult;
import org.junit.Ignore;
import org.junit.runners.model.FrameworkMethod;

public class TestMethodConfiguration {

    private final FrameworkMethod method;

    public TestMethodConfiguration(FrameworkMethod method) {
        this.method = method;
    }

    public static TestMethodConfiguration forMethod(FrameworkMethod method) {
        return new TestMethodConfiguration(method);
    }

    public boolean isManual() {
        return method.getAnnotation(Manual.class) != null;
    }

    public TestResult getManualResult() {
        return method.getAnnotation(Manual.class).result();
    }

    public boolean isIgnored() {
        return method.getAnnotation(Ignore.class) != null;
    }

    public boolean isPending() {
        return method.getAnnotation(Pending.class) != null;
    }


    public String getManualResultReason() {
        return method.getAnnotation(Manual.class).reason();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy