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

ch.abertschi.sct.arquillian.ReplayTestConfiguration Maven / Gradle / Ivy

package ch.abertschi.sct.arquillian;

import ch.abertschi.sct.arquillian.annotation.ReplayConfiguration;
import com.github.underscore.$;

import java.lang.reflect.Method;
import java.util.List;

/**
 * Created by abertschi on 01/06/16.
 */
public class ReplayTestConfiguration
{
    private ReplayConfiguration classConfiguration;

    private List methodConfigurations;

    private String testClassName;

    public ReplayTestConfiguration(Class testClass)
    {
        this.testClassName = testClass.getName();
    }

    public ReplayConfiguration getMethodConfiguration(Class testClass, Method testMethod)
    {
        List config = $.filter(methodConfigurations, method -> method.isOrigin(testClass, testMethod));
        return $.isEmpty(config) ? null : config.get(0);
    }

    public List getMethodConfigurations()
    {
        return methodConfigurations;
    }

    public ReplayTestConfiguration setMethodConfigurations(List methodConfigurations)
    {
        this.methodConfigurations = methodConfigurations;
        return this;
    }

    public ReplayConfiguration getClassConfiguration()
    {
        return classConfiguration;
    }

    public ReplayTestConfiguration setClassConfiguration(ReplayConfiguration classConfiguration)
    {
        this.classConfiguration = classConfiguration;
        return this;
    }

    public String getTestClassName()
    {
        return testClassName;
    }

    public boolean isTestClass(Class testClass)
    {
        return testClass.getName().equals(this.testClassName);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy