Migrate Scenario.write and Scenario.embed

MSAL

Cucumber-JVM 6.0.0 removed Scenario.write(String) and Scenario.embed(byte[], String) along with Scenario.embed(byte[], String, String), in favor of Scenario.log(String) and Scenario.attach(byte[], String, String). The two argument embed emitted an attachment without a name, which attach expresses as a null name.

org.openrewrite.cucumber.jvm.MigrateScenarioWriteAndEmbed
mod run . --recipe=org.openrewrite.cucumber.jvm.MigrateScenarioWriteAndEmbed

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Add a null method argument 2 in methods io.cucumber.java.Scenario embed(byte[], java.lang.String)
  2. Add a null method argument 2 in methods io.cucumber.java8.Scenario embed(byte[], java.lang.String)
  3. Change method name io.cucumber.java.Scenario embed(byte[], java.lang.String, java.lang.String) to attach
  4. Change method name io.cucumber.java8.Scenario embed(byte[], java.lang.String, java.lang.String) to attach
  5. Change method name io.cucumber.java.Scenario write(java.lang.String) to log
  6. Change method name io.cucumber.java8.Scenario write(java.lang.String) to log