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

com.tngtech.jgiven.integration.spring.SimpleSpringScenarioTest Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package com.tngtech.jgiven.integration.spring;

import org.junit.ClassRule;
import org.junit.Rule;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

import com.tngtech.jgiven.base.SimpleScenarioTestBase;
import com.tngtech.jgiven.junit.ScenarioExecutionRule;
import com.tngtech.jgiven.junit.ScenarioReportRule;

/**
 * A variant of {@link com.tngtech.jgiven.integration.spring.SpringScenarioTest} works with a single
 * stage type parameter instead of three.
 * 
 * @param  the stage class that contains the step definitions
 */
public class SimpleSpringScenarioTest extends SimpleScenarioTestBase implements BeanFactoryAware {

    @ClassRule
    public static final ScenarioReportRule writerRule = new ScenarioReportRule();

    @Rule
    public final ScenarioExecutionRule scenarioRule = new ScenarioExecutionRule( getScenario() );

    public void setBeanFactory( BeanFactory beanFactory ) {
        getScenario().setExecutor( beanFactory.getBean( SpringScenarioExecutor.class ) );
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy