com.tngtech.jgiven.base.SimpleScenarioTestBase Maven / Gradle / Ivy
package com.tngtech.jgiven.base;
import com.google.common.reflect.TypeToken;
import com.tngtech.jgiven.impl.Scenario;
/**
* ScenarioTest that only takes a single type parameter that is
* used for all three step definition types.
* Useful for simple scenarios where multiple classes for step definitions offer no benefit.
* This class is typically not directly used by end users,
* but instead test-framework-specific classes for JUnit or TestNG
*/
public abstract class SimpleScenarioTestBase extends ScenarioTestBase {
@Override
@SuppressWarnings( { "serial", "unchecked" } )
protected Scenario createScenario() {
Class stepsClass = (Class) new TypeToken( getClass() ) {}.getRawType();
return Scenario.create( stepsClass );
}
}