All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tngtech.jgiven.base.SimpleScenarioTestBase Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
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 );
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy