@Test public void should_return_en_keywords() { GherkinDialect dialect = GherkinDialectProvider.getDialect("en"); assertThat(dialect.getLanguage()).isEqualTo("en"); assertThat(dialect.getFeatureKeywords()).hasSize(3); assertThat(dialect.getFeatureKeywords().contains("Feature")).isTrue(); assertThat(dialect.getFeatureKeywords().contains("Ability")).isTrue(); assertThat(dialect.getFeatureKeywords().contains("Business Need")).isTrue(); assertThat(dialect.getBackgroundKeywords()).hasSize(1); assertThat(dialect.getBackgroundKeywords().contains("Background")).isTrue(); assertThat(dialect.getScenarioKeywords()).hasSize(1); assertThat(dialect.getScenarioKeywords().contains("Scenario")).isTrue(); assertThat(dialect.getScenarioOutlineKeywords()).hasSize(2); assertThat(dialect.getScenarioOutlineKeywords().contains("Scenario Outline")).isTrue(); assertThat(dialect.getScenarioOutlineKeywords().contains("Scenario Template")).isTrue(); assertThat(dialect.getExamplesKeywords()).hasSize(2); assertThat(dialect.getExamplesKeywords().contains("Examples")).isTrue(); assertThat(dialect.getExamplesKeywords().contains("Scenarios")).isTrue(); assertThat(dialect.getStepKeywords()).hasSize(6); assertThat(dialect.getStepKeywords().contains("Given ")).isTrue(); assertThat(dialect.getStepKeywords().contains("When ")).isTrue(); assertThat(dialect.getStepKeywords().contains("Then ")).isTrue(); assertThat(dialect.getStepKeywords().contains("But ")).isTrue(); assertThat(dialect.getStepKeywords().contains("And ")).isTrue(); assertThat(dialect.getStepKeywords().contains("* ")).isTrue(); assertThat(dialect.getGivenStepKeywords()).hasSize(1); assertThat(dialect.getGivenStepKeywords().contains("Given ")).isTrue(); assertThat(dialect.getWhenStepKeywords()).hasSize(1); assertThat(dialect.getWhenStepKeywords().contains("When ")).isTrue(); assertThat(dialect.getThenStepKeywords()).hasSize(1); assertThat(dialect.getThenStepKeywords().contains("Then ")).isTrue(); assertThat(dialect.getAndStepKeywords()).hasSize(1); assertThat(dialect.getAndStepKeywords().contains("And ")).isTrue(); assertThat(dialect.getButStepKeywords()).hasSize(1); assertThat(dialect.getButStepKeywords().contains("But ")).isTrue(); }
public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } private  GherkinDialectProvider(); }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } private  GherkinDialectProvider(); static GherkinDialect getDialect(String language); }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } private  GherkinDialectProvider(); static GherkinDialect getDialect(String language); static final Pattern LANGUAGE_DECLARATION_PATTERN; static final String DEFAULT_LANGUAGE; }