Skip to content

Commit

Permalink
Introduce Quarkus 3.18 Migration Scripts
Browse files Browse the repository at this point in the history
- This removes the `quarkus.flyway.clean-on-validation-error`. See quarkusio/quarkus#44912
  • Loading branch information
gastaldi committed Dec 4, 2024
1 parent e3e5d47 commit 6f2d7fe
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.quarkus.updates.core;

import org.intellij.lang.annotations.Language;
import org.junit.jupiter.api.Test;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

import java.nio.file.Path;

import static org.openrewrite.properties.Assertions.properties;

public class CoreUpdate318Test implements RewriteTest {

@Override
public void defaults(RecipeSpec spec) {
CoreTestUtil.recipe(spec, Path.of("quarkus-updates", "core", "3.18.yaml"), "3.18.0")
.parser(JavaParser.fromJavaVersion().logCompilationWarningsAndErrors(true))
.typeValidationOptions(TypeValidation.none());
}

@Test
void testFlywayConfigurationUpdated() {

@Language("properties")
String originalProperties = """
quarkus.flyway."datasource-name".clean-on-validation-error=true
%test.quarkus.flyway."datasource-name".clean-on-validation-error=true
quarkus.flyway.clean-on-validation-error=true
""";

@Language("properties")
String afterProperties = """
""";

rewriteRun(properties(originalProperties, afterProperties, spec -> spec.path("src/main/resources/application.properties")));
}
}
9 changes: 9 additions & 0 deletions recipes/src/main/resources/quarkus-updates/core/3.18.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#####
# Remove the `quarkus.flyway.clean-on-validation-error` property
#####
---
type: specs.openrewrite.org/v1beta/recipe
name: io.quarkus.updates.core.quarkus318.RemoveFlywayCleanOnValidationError
recipeList:
- org.openrewrite.quarkus.DeleteQuarkusProperty:
propertyKey: quarkus\.flyway\.(.+\.)?clean-on-validation-error

0 comments on commit 6f2d7fe

Please sign in to comment.