From 65fb0cf71643037d1c472348317fa88a2f32bb3b Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Thu, 1 Aug 2024 12:55:46 +0200 Subject: [PATCH] Deserialize AddRuntimeConfig.Separator notation Fixes https://github.com/openrewrite/rewrite/issues/4368 --- .../openrewrite/maven/AddRuntimeConfig.java | 4 +++ .../maven/AddRuntimeConfigTest.java | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java index 132506987d3..7adcaa8ec10 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java @@ -15,6 +15,7 @@ */ package org.openrewrite.maven; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.*; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; @@ -65,8 +66,11 @@ public class AddRuntimeConfig extends ScanningRecipe spec.recipeFromYaml( + """ + type: specs.openrewrite.org/v1beta/recipe + name: org.test.AddRuntimeConfig + description: Test deserialization. + recipeList: + - org.openrewrite.maven.AddRuntimeConfig: + relativeConfigFileName: maven.config + flag: -T + argument: 3 + separator: '=' + """, "org.test.AddRuntimeConfig" + ), + POM_XML_SOURCE_SPEC, + text( + null, + "-T=3", + spec -> spec.path(MAVEN_CONFIG_PATH) + ) + ); + } + @Test void appendRuntimeFlagToEmptyConfigFile() { rewriteRun(