
com.tngtech.jgiven.integration.spring.SpringScenarioTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jgiven-spring Show documentation
Show all versions of jgiven-spring Show documentation
Module for using Spring dependency injection together with JGiven
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.ScenarioTestBase;
import com.tngtech.jgiven.junit.ScenarioExecutionRule;
import com.tngtech.jgiven.junit.ScenarioReportRule;
/**
* Base class for {@link SpringScenarioExecutor} based JGiven tests
*
* @param
* @param
* @param
*
* @since 0.8.0
*/
public class SpringScenarioTest extends
ScenarioTestBase 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