From dcbd5f0a099588d64368d97d62e93c9b186a34ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Jourdan-Weil?= Date: Mon, 22 Sep 2025 12:56:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20implement=20language=20?= =?UTF-8?q?in=20Snippet=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ .../src/main/scala/io/cucumber/scala/ScalaSnippet.scala | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd70188..468fbe32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,12 @@ See also the [CHANGELOG](https://github.com/cucumber/cucumber-jvm/blob/master/CH ### Added +- [Scala] `ScalaSnippet` now implements `language()` method from `io.cucumber.core.backend.Snippet` + ### Changed +- [Core] Update `cucumber-core` dependency to [7.29.0](https://github.com/cucumber/cucumber-jvm/blob/main/CHANGELOG.md) + ### Deprecated ### Removed diff --git a/cucumber-scala/src/main/scala/io/cucumber/scala/ScalaSnippet.scala b/cucumber-scala/src/main/scala/io/cucumber/scala/ScalaSnippet.scala index 0a6b119a..7f0733b0 100644 --- a/cucumber-scala/src/main/scala/io/cucumber/scala/ScalaSnippet.scala +++ b/cucumber-scala/src/main/scala/io/cucumber/scala/ScalaSnippet.scala @@ -3,6 +3,7 @@ package io.cucumber.scala import java.lang.reflect.Type import java.text.MessageFormat import java.util.{Map => JMap} +import java.util.Optional import io.cucumber.core.backend.Snippet import io.cucumber.datatable.DataTable @@ -20,6 +21,10 @@ class ScalaSnippet extends Snippet { import ScalaSnippet.tripleDoubleQuotes + override def language(): Optional[String] = { + Optional.of("scala") + } + override def template(): MessageFormat = { new MessageFormat( s"""{0}(${tripleDoubleQuotes}{1}${tripleDoubleQuotes}) '{' ({3}) =>