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

cucumber.runtime.HookDefinitionMatch Maven / Gradle / Ivy

There is a newer version: 7.18.1
Show newest version
package cucumber.runtime;

import cucumber.api.Scenario;

import java.util.Collections;
import java.util.List;

public class HookDefinitionMatch implements DefinitionMatch {
    private final HookDefinition hookDefinition;

    public HookDefinitionMatch(HookDefinition hookDefinition) {
        this.hookDefinition = hookDefinition;
    }

    @Override
    public void runStep(String language, Scenario scenario) throws Throwable {
        hookDefinition.execute(scenario);
    }

    @Override
    public void dryRunStep(String language, Scenario scenario) throws Throwable {
        // Do nothing
    }

    @Override
    public Match getMatch() {
        return new Match(Collections.emptyList(), hookDefinition.getLocation(false));
    }

    @Override
    public String getPattern() {
        throw new UnsupportedOperationException();
    }

    @Override
    public String getCodeLocation() {
        return hookDefinition.getLocation(false);
    }

    @Override
    public List getArguments() {
        return Collections.emptyList();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy