Search in sources :

Example 1 with ParameterTypeRegistry

use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.

the class JavaSnippetTest method snippetForDocString.

private String snippetForDocString(String stepText, String docString, ParameterType<String> parameterType) {
    Step step = createStepWithDocString(stepText, docString);
    ParameterTypeRegistry parameterTypeRegistry = new ParameterTypeRegistry(Locale.ENGLISH);
    parameterTypeRegistry.defineParameterType(parameterType);
    List<String> snippet = new SnippetGenerator(new JavaSnippet(), parameterTypeRegistry).getSnippet(step, snippetType);
    return String.join("\n", snippet);
}
Also used : ParameterTypeRegistry(io.cucumber.cucumberexpressions.ParameterTypeRegistry) SnippetGenerator(io.cucumber.core.snippets.SnippetGenerator) Step(io.cucumber.core.gherkin.Step)

Example 2 with ParameterTypeRegistry

use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.

the class JavaSnippetTest method snippetForDataTable.

private String snippetForDataTable(String stepText, ParameterType<String> parameterType) {
    Step step = createStepWithDataTable(stepText);
    ParameterTypeRegistry parameterTypeRegistry = new ParameterTypeRegistry(Locale.ENGLISH);
    parameterTypeRegistry.defineParameterType(parameterType);
    List<String> snippet = new SnippetGenerator(new JavaSnippet(), parameterTypeRegistry).getSnippet(step, snippetType);
    return String.join("\n", snippet);
}
Also used : ParameterTypeRegistry(io.cucumber.cucumberexpressions.ParameterTypeRegistry) SnippetGenerator(io.cucumber.core.snippets.SnippetGenerator) Step(io.cucumber.core.gherkin.Step)

Example 3 with ParameterTypeRegistry

use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.

the class JavaSnippetTest method snippetFor.

private String snippetFor(String stepText) {
    Step step = createStep(stepText);
    List<String> snippet = new SnippetGenerator(new JavaSnippet(), new ParameterTypeRegistry(Locale.ENGLISH)).getSnippet(step, snippetType);
    return String.join("\n", snippet);
}
Also used : SnippetGenerator(io.cucumber.core.snippets.SnippetGenerator) ParameterTypeRegistry(io.cucumber.cucumberexpressions.ParameterTypeRegistry) Step(io.cucumber.core.gherkin.Step)

Example 4 with ParameterTypeRegistry

use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.

the class JavaSnippetTest method snippetForDocString.

private String snippetForDocString(String stepText, String docString) {
    Step step = createStepWithDocString(stepText, docString);
    List<String> snippet = new SnippetGenerator(new JavaSnippet(), new ParameterTypeRegistry(Locale.ENGLISH)).getSnippet(step, snippetType);
    return String.join("\n", snippet);
}
Also used : SnippetGenerator(io.cucumber.core.snippets.SnippetGenerator) ParameterTypeRegistry(io.cucumber.cucumberexpressions.ParameterTypeRegistry) Step(io.cucumber.core.gherkin.Step)

Example 5 with ParameterTypeRegistry

use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.

the class JavaSnippetTest method snippetForDataTable.

private String snippetForDataTable(String stepText) {
    Step step = createStepWithDataTable(stepText);
    List<String> snippet = new SnippetGenerator(new JavaSnippet(), new ParameterTypeRegistry(Locale.ENGLISH)).getSnippet(step, snippetType);
    return String.join("\n", snippet);
}
Also used : SnippetGenerator(io.cucumber.core.snippets.SnippetGenerator) ParameterTypeRegistry(io.cucumber.cucumberexpressions.ParameterTypeRegistry) Step(io.cucumber.core.gherkin.Step)

Aggregations

Step (io.cucumber.core.gherkin.Step)8 SnippetGenerator (io.cucumber.core.snippets.SnippetGenerator)8 ParameterTypeRegistry (io.cucumber.cucumberexpressions.ParameterTypeRegistry)8 Feature (io.cucumber.core.gherkin.Feature)2