![JAR search and dependency download from the Maven repository](/logo.png)
com.tngtech.jgiven.integration.spring.junit5.DualSpringScenarioTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jgiven-spring-junit5 Show documentation
Show all versions of jgiven-spring-junit5 Show documentation
Module for using Spring dependency injection together with JGiven and JUnit 5
package com.tngtech.jgiven.integration.spring.junit5;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import com.tngtech.jgiven.base.DualScenarioTestBase;
import com.tngtech.jgiven.impl.Scenario;
import com.tngtech.jgiven.integration.spring.SpringStageCreator;
import com.tngtech.jgiven.junit5.JGivenExtension;
/**
* Base class for Spring 5 and JUnit 5 test with two stage class parameter
*
* @param the GIVEN and WHEN stage class
* @param the THEN stage class
*
* @since 1.0.0
*/
@ExtendWith( {SpringExtension.class, JGivenExtension.class} )
public class DualSpringScenarioTest extends
DualScenarioTestBase implements BeanFactoryAware {
private Scenario scenario = createScenario();
@Override
public Scenario getScenario() {
return scenario;
}
@Override
public void setBeanFactory( BeanFactory beanFactory ) {
getScenario().setStageCreator( beanFactory.getBean( SpringStageCreator.class ) );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy