com.tngtech.jgiven.integration.spring.DualSpringScenarioTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jgiven-spring-junit4 Show documentation
Show all versions of jgiven-spring-junit4 Show documentation
Module for using Spring dependency injection together with JGiven and JUnit 4
package com.tngtech.jgiven.integration.spring;
import com.tngtech.jgiven.junit.DualScenarioTest;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
/**
* A variant of {@link SpringScenarioTest} works with two
* stage type parameters instead of three.
*
* @param the stage class that contains the step definitions for given and when
* @param the stage class that contains the step definitions for then
*/
public class DualSpringScenarioTest extends DualScenarioTest implements BeanFactoryAware {
public void setBeanFactory( BeanFactory beanFactory ) {
getScenario().setStageCreator( beanFactory.getBean( SpringStageCreator.class ) );
}
}