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-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 org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import com.tngtech.jgiven.junit.ScenarioTest;
/**
* Base class for {@link SpringStageCreator} based JGiven tests.
*
* Needs to be used with the {@link org.springframework.test.context.junit4.SpringJUnit4ClassRunner}.
* As a JUnit-rule based alternative, consider using {@link SpringRuleScenarioTest}.
*
* @param
* @param
* @param
*
* @since 0.8.0
*/
public class SpringScenarioTest extends
ScenarioTest implements BeanFactoryAware {
@Override
public void setBeanFactory( BeanFactory beanFactory ) {
getScenario().setStageCreator( beanFactory.getBean( SpringStageCreator.class ) );
}
}