diff --git a/.github/workflows/optaplanner-9.yml b/.github/workflows/optaplanner-9.yml deleted file mode 100644 index 465d199fd68..00000000000 --- a/.github/workflows/optaplanner-9.yml +++ /dev/null @@ -1,48 +0,0 @@ -# Runs the SonarCloud analysis of the optaplanner main branch after a PR is merged. -name: OptaPlanner 9 - -on: - pull_request: - types: [ opened, synchronize, reopened, labeled ] - branches: - - main - paths-ignore: - - 'LICENSE*' - - '.gitignore' - - '**.md' - - '**.adoc' - - '*.txt' - - '.ci/**' - -defaults: - run: - shell: bash - -jobs: - optaplanner-9: - name: ${{ matrix.os }} - Java ${{ matrix.java-version }} - strategy: - matrix: - os: [ ubuntu-latest ] - java-version: [ 17 ] - maven-version: [ '3.8.7' ] - fail-fast: false - runs-on: ${{ matrix.os }} - - steps: - - name: Check out repository code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Java and Maven Setup - uses: apache/incubator-kie-kogito-pipelines/.ci/actions/maven@main - with: - java-version: ${{ matrix.java-version }} - maven-version: ${{ matrix.maven-version }} - cache-key-prefix: ${{ runner.os }}-${{ matrix.java-version }}-maven${{ matrix.maven-version }} - - - name: Migrate to 9 - run: ./build/8-to-9-migration/migrate.sh --no-version-upgrade --no-commit - - name: Build with Maven - run: mvn -B --fail-at-end clean install -Dfull -Dformatter.skip diff --git a/optaplanner-migration/.gitignore b/optaplanner-migration/.gitignore deleted file mode 100644 index 222af0cf114..00000000000 --- a/optaplanner-migration/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/target -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/optaplanner-migration/pom.xml b/optaplanner-migration/pom.xml deleted file mode 100644 index f911af8b564..00000000000 --- a/optaplanner-migration/pom.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - 4.0.0 - - org.optaplanner - optaplanner-build-parent - 999-SNAPSHOT - ../build/optaplanner-build-parent/pom.xml - - - optaplanner-migration - - OptaPlanner Migration - - Upgrade your code with a single command. - This migration replace all your calls to deleted/deprecated methods of OptaPlanner with their proper alternatives. - - https://www.optaplanner.org - - - org.optaplanner.migration - 4.13.0 - 2.3.3 - - - - - - - org.antlr - antlr4 - ${version.org.antlr} - - - org.antlr - antlr4-runtime - ${version.org.antlr} - - - - jakarta.xml.bind - jakarta.xml.bind-api - ${version.jakarta.xml.bind.override} - - - - - - - org.openrewrite - rewrite-core - - - org.openrewrite - rewrite-java - - - org.openrewrite - rewrite-maven - - - org.openrewrite - rewrite-xml - - - org.openrewrite - rewrite-java-11 - runtime - - - org.openrewrite - rewrite-properties - runtime - - - - - org.junit.jupiter - junit-jupiter-api - test - - - org.openrewrite - rewrite-test - test - - - commons-logging - commons-logging - - - - - org.slf4j - slf4j-api - - - org.slf4j - jcl-over-slf4j - runtime - - - - org.optaplanner - optaplanner-core-impl - runtime - - - - diff --git a/optaplanner-migration/src/main/java/org/optaplanner/migration/jakarta/InternalOptaPlannerMavenVisitor.java b/optaplanner-migration/src/main/java/org/optaplanner/migration/jakarta/InternalOptaPlannerMavenVisitor.java deleted file mode 100644 index fac05699bcc..00000000000 --- a/optaplanner-migration/src/main/java/org/optaplanner/migration/jakarta/InternalOptaPlannerMavenVisitor.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.jakarta; - -import org.openrewrite.ExecutionContext; -import org.openrewrite.marker.SearchResult; -import org.openrewrite.maven.MavenVisitor; -import org.openrewrite.maven.tree.ResolvedPom; -import org.openrewrite.xml.tree.Xml; - -final class InternalOptaPlannerMavenVisitor extends MavenVisitor { - - private static final String GROUP_ID = "org.optaplanner"; - private static final String ARTIFACT_ID_PREFIX = "optaplanner-"; - - @Override - public Xml visitDocument(Xml.Document document, ExecutionContext executionContext) { - ResolvedPom pom = getResolutionResult().getPom(); - if (pom.getGroupId().equals(GROUP_ID) && pom.getArtifactId().startsWith(ARTIFACT_ID_PREFIX)) { - return SearchResult.found(document); - } - return document; - } -} diff --git a/optaplanner-migration/src/main/java/org/optaplanner/migration/jakarta/JakartaJsonMigrationRecipe.java b/optaplanner-migration/src/main/java/org/optaplanner/migration/jakarta/JakartaJsonMigrationRecipe.java deleted file mode 100644 index 79fe9201d5c..00000000000 --- a/optaplanner-migration/src/main/java/org/optaplanner/migration/jakarta/JakartaJsonMigrationRecipe.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.jakarta; - -import java.nio.file.Path; - -import org.openrewrite.ExecutionContext; -import org.openrewrite.Recipe; -import org.openrewrite.TreeVisitor; -import org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId; -import org.openrewrite.maven.MavenIsoVisitor; -import org.openrewrite.maven.MavenVisitor; -import org.openrewrite.maven.RemoveDependency; -import org.openrewrite.maven.RemoveExclusion; -import org.openrewrite.xml.tree.Xml; - -public class JakartaJsonMigrationRecipe extends Recipe { - - private static final String OPTAPLANNER_JSONB_MODULE = "optaplanner-persistence-jsonb"; - private static final String ORG_GLASSFISH = "org.glassfish"; - private static final String ORG_ECLIPSE = "org.eclipse"; - private static final String JAKARTA_JSON = "jakarta.json"; - private static final String JAKARTA_JSON_API = "jakarta.json-api"; - private static final String YASSON = "yasson"; - - @Override - public String getDisplayName() { - return "Migrate Json artifacts to Jakarta"; - } - - @Override - public String getDescription() { - return "Migrates 'org.glassfish:jakarta.json' to 'jakarta.json:jakarta.json-api'."; - } - - @Override - protected MavenVisitor getSingleSourceApplicableTest() { - return new InternalOptaPlannerMavenVisitor(); - } - - @Override - protected TreeVisitor getVisitor() { - return new MavenIsoVisitor<>() { - @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { - Path parent = document.getSourcePath().getParent(); - if (parent != null && parent.toString().endsWith(OPTAPLANNER_JSONB_MODULE)) { - doNext(new RemoveDependency(ORG_GLASSFISH, JAKARTA_JSON, "runtime")); - doNext(new RemoveExclusion(ORG_ECLIPSE, YASSON, JAKARTA_JSON, JAKARTA_JSON_API, false)); - doNext(new RemoveExclusion(ORG_ECLIPSE, YASSON, ORG_GLASSFISH, JAKARTA_JSON, false)); - } else { - doNext(new ChangeDependencyGroupIdAndArtifactId(ORG_GLASSFISH, JAKARTA_JSON, JAKARTA_JSON, - JAKARTA_JSON_API, null, null)); - } - return super.visitDocument(document, executionContext); - } - }; - } -} diff --git a/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/AsConstraintRecipe.java b/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/AsConstraintRecipe.java deleted file mode 100644 index 95c2ab627d2..00000000000 --- a/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/AsConstraintRecipe.java +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.v8; - -import java.util.Arrays; -import java.util.List; -import java.util.regex.Pattern; - -import org.openrewrite.ExecutionContext; -import org.openrewrite.Recipe; -import org.openrewrite.TreeVisitor; -import org.openrewrite.java.JavaIsoVisitor; -import org.openrewrite.java.JavaParser; -import org.openrewrite.java.JavaTemplate; -import org.openrewrite.java.MethodMatcher; -import org.openrewrite.java.search.UsesMethod; -import org.openrewrite.java.tree.Expression; -import org.openrewrite.java.tree.J; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AsConstraintRecipe extends Recipe { - - private static final Logger LOGGER = LoggerFactory.getLogger(AsConstraintRecipe.class); - - private static final MatcherMeta[] MATCHER_METAS = { - new MatcherMeta("ConstraintStream", "penalize(String, Score)"), - new MatcherMeta("ConstraintStream", "penalize(String, String, Score)"), - new MatcherMeta("ConstraintStream", "penalizeConfigurable(String)"), - new MatcherMeta("ConstraintStream", "penalizeConfigurable(String, String)"), - new MatcherMeta("ConstraintStream", "reward(String, Score)"), - new MatcherMeta("ConstraintStream", "reward(String, String, Score)"), - new MatcherMeta("ConstraintStream", "rewardConfigurable(String)"), - new MatcherMeta("ConstraintStream", "rewardConfigurable(String, String)"), - new MatcherMeta("ConstraintStream", "impact(String, Score)"), - new MatcherMeta("ConstraintStream", "impact(String, String, Score)"), - new MatcherMeta("ConstraintStream", "impactConfigurable(String)"), - new MatcherMeta("ConstraintStream", "impactConfigurable(String, String)"), - - new MatcherMeta("UniConstraintStream", "penalize(String, Score, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "penalize(String, String, Score, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "penalizeConfigurable(String, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "penalizeConfigurable(String, String, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "penalizeLong(String, Score, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "penalizeLong(String, String, Score, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "penalizeConfigurableLong(String, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "penalizeConfigurableLong(String, String, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "penalizeBigDecimal(String, Score, Function)"), - new MatcherMeta("UniConstraintStream", "penalizeBigDecimal(String, String, Score, Function)"), - new MatcherMeta("UniConstraintStream", "penalizeConfigurableBigDecimal(String, Function)"), - new MatcherMeta("UniConstraintStream", "penalizeConfigurableBigDecimal(String, String, Function)"), - new MatcherMeta("UniConstraintStream", "reward(String, Score, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "reward(String, String, Score, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "rewardConfigurable(String, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "rewardConfigurable(String, String, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "rewardLong(String, Score, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "rewardLong(String, String, Score, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "rewardConfigurableLong(String, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "rewardConfigurableLong(String, String, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "rewardBigDecimal(String, Score, Function)"), - new MatcherMeta("UniConstraintStream", "rewardBigDecimal(String, String, Score, Function)"), - new MatcherMeta("UniConstraintStream", "rewardConfigurableBigDecimal(String, Function)"), - new MatcherMeta("UniConstraintStream", "rewardConfigurableBigDecimal(String, String, Function)"), - new MatcherMeta("UniConstraintStream", "impact(String, Score, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "impact(String, String, Score, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "impactConfigurable(String, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "impactConfigurable(String, String, ToIntFunction)"), - new MatcherMeta("UniConstraintStream", "impactLong(String, Score, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "impactLong(String, String, Score, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "impactConfigurableLong(String, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "impactConfigurableLong(String, String, ToLongFunction)"), - new MatcherMeta("UniConstraintStream", "impactBigDecimal(String, Score, Function)"), - new MatcherMeta("UniConstraintStream", "impactBigDecimal(String, String, Score, Function)"), - new MatcherMeta("UniConstraintStream", "impactConfigurableBigDecimal(String, Function)"), - new MatcherMeta("UniConstraintStream", "impactConfigurableBigDecimal(String, String, Function)"), - - new MatcherMeta("BiConstraintStream", "penalize(String, Score, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalize(String, String, Score, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeConfigurable(String, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeConfigurable(String, String, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeLong(String, Score, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeLong(String, String, Score, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeConfigurableLong(String, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeConfigurableLong(String, String, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeBigDecimal(String, Score, BiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeBigDecimal(String, String, Score, BiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeConfigurableBigDecimal(String, BiFunction)"), - new MatcherMeta("BiConstraintStream", "penalizeConfigurableBigDecimal(String, String, BiFunction)"), - new MatcherMeta("BiConstraintStream", "reward(String, Score, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "reward(String, String, Score, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardConfigurable(String, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardConfigurable(String, String, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardLong(String, Score, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardLong(String, String, Score, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardConfigurableLong(String, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardConfigurableLong(String, String, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardBigDecimal(String, Score, BiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardBigDecimal(String, String, Score, BiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardConfigurableBigDecimal(String, BiFunction)"), - new MatcherMeta("BiConstraintStream", "rewardConfigurableBigDecimal(String, String, BiFunction)"), - new MatcherMeta("BiConstraintStream", "impact(String, Score, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "impact(String, String, Score, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "impactConfigurable(String, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "impactConfigurable(String, String, ToIntBiFunction)"), - new MatcherMeta("BiConstraintStream", "impactLong(String, Score, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "impactLong(String, String, Score, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "impactConfigurableLong(String, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "impactConfigurableLong(String, String, ToLongBiFunction)"), - new MatcherMeta("BiConstraintStream", "impactBigDecimal(String, Score, BiFunction)"), - new MatcherMeta("BiConstraintStream", "impactBigDecimal(String, String, Score, BiFunction)"), - new MatcherMeta("BiConstraintStream", "impactConfigurableBigDecimal(String, BiFunction)"), - new MatcherMeta("BiConstraintStream", "impactConfigurableBigDecimal(String, String, BiFunction)"), - - new MatcherMeta("TriConstraintStream", "penalize(String, Score, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalize(String, String, Score, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeConfigurable(String, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeConfigurable(String, String, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeLong(String, Score, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeLong(String, String, Score, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeConfigurableLong(String, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeConfigurableLong(String, String, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeBigDecimal(String, Score, TriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeBigDecimal(String, String, Score, TriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeConfigurableBigDecimal(String, TriFunction)"), - new MatcherMeta("TriConstraintStream", "penalizeConfigurableBigDecimal(String, String, TriFunction)"), - new MatcherMeta("TriConstraintStream", "reward(String, Score, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "reward(String, String, Score, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardConfigurable(String, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardConfigurable(String, String, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardLong(String, Score, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardLong(String, String, Score, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardConfigurableLong(String, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardConfigurableLong(String, String, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardBigDecimal(String, Score, TriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardBigDecimal(String, String, Score, TriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardConfigurableBigDecimal(String, TriFunction)"), - new MatcherMeta("TriConstraintStream", "rewardConfigurableBigDecimal(String, String, TriFunction)"), - new MatcherMeta("TriConstraintStream", "impact(String, Score, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "impact(String, String, Score, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "impactConfigurable(String, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "impactConfigurable(String, String, ToIntTriFunction)"), - new MatcherMeta("TriConstraintStream", "impactLong(String, Score, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "impactLong(String, String, Score, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "impactConfigurableLong(String, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "impactConfigurableLong(String, String, ToLongTriFunction)"), - new MatcherMeta("TriConstraintStream", "impactBigDecimal(String, Score, TriFunction)"), - new MatcherMeta("TriConstraintStream", "impactBigDecimal(String, String, Score, TriFunction)"), - new MatcherMeta("TriConstraintStream", "impactConfigurableBigDecimal(String, TriFunction)"), - new MatcherMeta("TriConstraintStream", "impactConfigurableBigDecimal(String, String, TriFunction)"), - - new MatcherMeta("QuadConstraintStream", "penalize(String, Score, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalize(String, String, Score, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeConfigurable(String, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeConfigurable(String, String, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeLong(String, Score, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeLong(String, String, Score, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeConfigurableLong(String, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeConfigurableLong(String, String, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeBigDecimal(String, Score, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeBigDecimal(String, String, Score, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeConfigurableBigDecimal(String, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "penalizeConfigurableBigDecimal(String, String, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "reward(String, Score, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "reward(String, String, Score, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardConfigurable(String, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardConfigurable(String, String, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardLong(String, Score, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardLong(String, String, Score, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardConfigurableLong(String, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardConfigurableLong(String, String, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardBigDecimal(String, Score, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardBigDecimal(String, String, Score, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardConfigurableBigDecimal(String, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "rewardConfigurableBigDecimal(String, String, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impact(String, Score, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impact(String, String, Score, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactConfigurable(String, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactConfigurable(String, String, ToIntQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactLong(String, Score, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactLong(String, String, Score, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactConfigurableLong(String, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactConfigurableLong(String, String, ToLongQuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactBigDecimal(String, Score, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactBigDecimal(String, String, Score, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactConfigurableBigDecimal(String, QuadFunction)"), - new MatcherMeta("QuadConstraintStream", "impactConfigurableBigDecimal(String, String, QuadFunction)"), - }; - - @Override - public String getDisplayName() { - return "ConstraintStreams: use asConstraint() methods to define constraints"; - } - - @Override - public String getDescription() { - return "Use `penalize().asConstraint()` and `reward().asConstraint()`" + - " instead of the deprecated `penalize()` and `reward()` methods."; - } - - @Override - protected TreeVisitor getSingleSourceApplicableTest() { - return new JavaIsoVisitor<>() { - @Override - public J.CompilationUnit visitCompilationUnit( - J.CompilationUnit compilationUnit, ExecutionContext executionContext) { - for (MatcherMeta matcherMeta : MATCHER_METAS) { - doAfterVisit(new UsesMethod<>(matcherMeta.methodMatcher)); - } - return compilationUnit; - } - }; - } - - @Override - protected TreeVisitor getVisitor() { - return new JavaIsoVisitor<>() { - - private final Pattern uniConstraintStreamPattern = Pattern.compile( - "org.optaplanner.core.api.score.stream.uni.UniConstraintStream"); - private final Pattern biConstraintStreamPattern = Pattern.compile( - "org.optaplanner.core.api.score.stream.bi.BiConstraintStream"); - private final Pattern triConstraintStreamPattern = Pattern.compile( - "org.optaplanner.core.api.score.stream.tri.TriConstraintStream"); - private final Pattern quadConstraintStreamPattern = Pattern.compile( - "org.optaplanner.core.api.score.stream.quad.QuadConstraintStream"); - - @Override - public Expression visitExpression(Expression expression, ExecutionContext executionContext) { - final Expression e = super.visitExpression(expression, executionContext); - - MatcherMeta matcherMeta = Arrays.stream(MATCHER_METAS).filter(m -> m.methodMatcher.matches(e)) - .findFirst().orElse(null); - if (matcherMeta == null) { - return e; - } - J.MethodInvocation mi = (J.MethodInvocation) e; - Expression select = mi.getSelect(); - List arguments = mi.getArguments(); - - String templateCode; - if (select.getType().isAssignableFrom(uniConstraintStreamPattern)) { - templateCode = "#{any(org.optaplanner.core.api.score.stream.uni.UniConstraintStream)}\n"; - } else if (select.getType().isAssignableFrom(biConstraintStreamPattern)) { - templateCode = "#{any(org.optaplanner.core.api.score.stream.bi.BiConstraintStream)}\n"; - } else if (select.getType().isAssignableFrom(triConstraintStreamPattern)) { - templateCode = "#{any(org.optaplanner.core.api.score.stream.tri.TriConstraintStream)}\n"; - } else if (select.getType().isAssignableFrom(quadConstraintStreamPattern)) { - templateCode = "#{any(org.optaplanner.core.api.score.stream.quad.QuadConstraintStream)}\n"; - } else { - LOGGER.warn("Cannot refactor to asConstraint() method" + - " for deprecated method called in expression (" + e + ")."); - return e; - } - if (!matcherMeta.configurable) { - if (!matcherMeta.matchWeigherIncluded) { - templateCode += "." + matcherMeta.methodName + "(#{any(org.optaplanner.core.api.score.Score)})\n"; - } else { - templateCode += "." + matcherMeta.methodName + "(#{any(org.optaplanner.core.api.score.Score)}," + - " #{any(" + matcherMeta.functionType + ")})\n"; - } - } else { - if (!matcherMeta.matchWeigherIncluded) { - templateCode += "." + matcherMeta.methodName + "()\n"; - } else { - templateCode += "." + matcherMeta.methodName + "(" + - "#{any(" + matcherMeta.functionType + ")})\n"; - } - } - if (!matcherMeta.constraintPackageIncluded) { - templateCode += ".asConstraint(#{any(String)})"; - } else { - templateCode += ".asConstraint(#{any(String)}, #{any(String)})"; - } - JavaTemplate template = JavaTemplate.builder(() -> getCursor().getParentOrThrow(), templateCode) - .javaParser(() -> buildJavaParser().build()) - .build(); - if (!matcherMeta.constraintPackageIncluded) { - if (!matcherMeta.configurable) { - if (!matcherMeta.matchWeigherIncluded) { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(1), arguments.get(0)); - } else { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(1), arguments.get(2), arguments.get(0)); - } - } else { - if (!matcherMeta.matchWeigherIncluded) { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(0)); - } else { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(1), arguments.get(0)); - } - } - } else { - if (!matcherMeta.configurable) { - if (!matcherMeta.matchWeigherIncluded) { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(2), arguments.get(0), arguments.get(1)); - } else { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(2), arguments.get(3), arguments.get(0), arguments.get(1)); - } - } else { - if (!matcherMeta.matchWeigherIncluded) { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(0), arguments.get(1)); - } else { - return e.withTemplate(template, - e.getCoordinates().replace(), select, - arguments.get(2), arguments.get(0), arguments.get(1)); - } - } - } - } - }; - } - - public static JavaParser.Builder buildJavaParser() { - return JavaParser.fromJavaVersion().classpath("optaplanner-core-impl"); - } - - private static class MatcherMeta { - public MethodMatcher methodMatcher; - public boolean constraintPackageIncluded; - public boolean configurable; - public boolean matchWeigherIncluded; - public String methodName; // penalize, reward or impact - public String functionType; - - public MatcherMeta(String select, String method) { - String signature; - if (select.equals("ConstraintStream")) { - signature = "org.optaplanner.core.api.score.stream.ConstraintStream"; - } else if (select.equals("UniConstraintStream")) { - signature = "org.optaplanner.core.api.score.stream.uni.UniConstraintStream"; - } else if (select.equals("BiConstraintStream")) { - signature = "org.optaplanner.core.api.score.stream.bi.BiConstraintStream"; - } else if (select.equals("TriConstraintStream")) { - signature = "org.optaplanner.core.api.score.stream.tri.TriConstraintStream"; - } else if (select.equals("QuadConstraintStream")) { - signature = "org.optaplanner.core.api.score.stream.quad.QuadConstraintStream"; - } else { - throw new IllegalArgumentException("Invalid select (" + select + ")."); - } - signature += " " + method.replace(" Score", " org.optaplanner.core.api.score.Score") - .replace(" ToIntFunction", " java.util.function.ToIntFunction") - .replace(" ToLongFunction", " java.util.function.ToLongFunction") - .replace(" Function", " java.util.function.Function") - .replace(" ToIntBiFunction", " java.util.function.ToIntBiFunction") - .replace(" ToLongBiFunction", " java.util.function.ToLongBiFunction") - .replace(" BiFunction", " java.util.function.BiFunction") - .replace(" ToIntTriFunction", " org.optaplanner.core.api.function.ToIntTriFunction") - .replace(" ToLongTriFunction", " org.optaplanner.core.api.function.ToLongTriFunction") - .replace(" TriFunction", " org.optaplanner.core.api.function.TriFunction") - .replace(" ToIntQuadFunction", " org.optaplanner.core.api.function.ToIntQuadFunction") - .replace(" ToLongQuadFunction", " org.optaplanner.core.api.function.ToLongQuadFunction") - .replace(" QuadFunction", " org.optaplanner.core.api.function.QuadFunction"); - methodMatcher = new MethodMatcher(signature); - constraintPackageIncluded = method.contains("String, String"); - configurable = method.contains("Configurable"); - matchWeigherIncluded = method.contains("Function"); - if (matchWeigherIncluded) { - this.functionType = signature.replaceFirst("^.* ([\\w\\.]+Function)\\)$", "$1"); - } - this.methodName = method.replaceFirst("\\(.*$", ""); - } - } - -} diff --git a/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/ScoreGettersRecipe.java b/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/ScoreGettersRecipe.java deleted file mode 100644 index 2b1a19a0bde..00000000000 --- a/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/ScoreGettersRecipe.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.v8; - -import java.util.Arrays; -import java.util.List; - -import org.openrewrite.ExecutionContext; -import org.openrewrite.Recipe; -import org.openrewrite.TreeVisitor; -import org.openrewrite.java.JavaIsoVisitor; -import org.openrewrite.java.JavaParser; -import org.openrewrite.java.JavaTemplate; -import org.openrewrite.java.MethodMatcher; -import org.openrewrite.java.search.UsesMethod; -import org.openrewrite.java.tree.Expression; -import org.openrewrite.java.tree.J; - -public class ScoreGettersRecipe extends Recipe { - - private static final MatcherMeta[] MATCHER_METAS = { - new MatcherMeta("IBendableScore", "getHardLevelsSize()"), - new MatcherMeta("IBendableScore", "getSoftLevelsSize()"), - new MatcherMeta("IBendableScore", "getLevelsSize()"), - new MatcherMeta("Score", "getInitScore()"), - - new MatcherMeta("BendableScore", "getHardScores()"), - new MatcherMeta("BendableScore", "getHardScore(int)"), - new MatcherMeta("BendableScore", "getSoftScores()"), - new MatcherMeta("BendableScore", "getSoftScore(int)"), - - new MatcherMeta("BendableBigDecimalScore", "getHardScores()"), - new MatcherMeta("BendableBigDecimalScore", "getHardScore(int)"), - new MatcherMeta("BendableBigDecimalScore", "getSoftScores()"), - new MatcherMeta("BendableBigDecimalScore", "getSoftScore(int)"), - - new MatcherMeta("BendableLongScore", "getHardScores()"), - new MatcherMeta("BendableLongScore", "getHardScore(int)"), - new MatcherMeta("BendableLongScore", "getSoftScores()"), - new MatcherMeta("BendableLongScore", "getSoftScore(int)"), - - new MatcherMeta("HardMediumSoftScore", "getHardScore()"), - new MatcherMeta("HardMediumSoftScore", "getMediumScore()"), - new MatcherMeta("HardMediumSoftScore", "getSoftScore()"), - - new MatcherMeta("HardMediumSoftBigDecimalScore", "getHardScore()"), - new MatcherMeta("HardMediumSoftBigDecimalScore", "getMediumScore()"), - new MatcherMeta("HardMediumSoftBigDecimalScore", "getSoftScore()"), - - new MatcherMeta("HardMediumSoftLongScore", "getHardScore()"), - new MatcherMeta("HardMediumSoftLongScore", "getMediumScore()"), - new MatcherMeta("HardMediumSoftLongScore", "getSoftScore()"), - - new MatcherMeta("HardSoftScore", "getHardScore()"), - new MatcherMeta("HardSoftScore", "getSoftScore()"), - - new MatcherMeta("HardSoftBigDecimalScore", "getHardScore()"), - new MatcherMeta("HardSoftBigDecimalScore", "getSoftScore()"), - - new MatcherMeta("HardSoftLongScore", "getHardScore()"), - new MatcherMeta("HardSoftLongScore", "getSoftScore()"), - - new MatcherMeta("SimpleScore", "getScore()"), - - new MatcherMeta("SimpleBigDecimalScore", "getScore()"), - - new MatcherMeta("SimpleLongScore", "getScore()"), - }; - - @Override - public String getDisplayName() { - return "Score: use shorter getters"; - } - - @Override - public String getDescription() { - return "Use `score()` instead of `getScore()` on `Score` implementations."; - } - - @Override - protected TreeVisitor getSingleSourceApplicableTest() { - return new JavaIsoVisitor<>() { - @Override - public J.CompilationUnit visitCompilationUnit(J.CompilationUnit compilationUnit, - ExecutionContext executionContext) { - for (MatcherMeta matcherMeta : MATCHER_METAS) { - doAfterVisit(new UsesMethod<>(matcherMeta.methodMatcher)); - } - return compilationUnit; - } - }; - } - - @Override - protected TreeVisitor getVisitor() { - return new JavaIsoVisitor<>() { - - @Override - public Expression visitExpression(Expression expression, ExecutionContext executionContext) { - final Expression e = super.visitExpression(expression, executionContext); - - MatcherMeta matcherMeta = Arrays.stream(MATCHER_METAS).filter(m -> m.methodMatcher.matches(e)) - .findFirst().orElse(null); - if (matcherMeta == null) { - return e; - } - J.MethodInvocation mi = (J.MethodInvocation) e; - Expression select = mi.getSelect(); - List arguments = mi.getArguments(); - - String score = "#{any(" + matcherMeta.scoreClassFqn + ")}"; - String getterWithoutGet = - matcherMeta.methodName.substring(3, 4).toLowerCase() + - matcherMeta.methodName.substring(4); - String pattern = score + "." + getterWithoutGet; - if (getterWithoutGet.contains("(int)")) { - pattern = pattern.replace("(int)", "(#{any(int)})"); - JavaTemplate template = JavaTemplate.builder(() -> getCursor().getParentOrThrow(), pattern) - .javaParser(() -> buildJavaParser().build()) - .build(); - return e.withTemplate(template, e.getCoordinates().replace(), select, arguments.get(0)); - } else { - JavaTemplate template = JavaTemplate.builder(() -> getCursor().getParentOrThrow(), pattern) - .javaParser(() -> buildJavaParser().build()) - .build(); - return e.withTemplate(template, e.getCoordinates().replace(), select); - } - } - }; - } - - public static JavaParser.Builder buildJavaParser() { - return JavaParser.fromJavaVersion().classpath("optaplanner-core-impl"); - } - - private static final class MatcherMeta { - - public final String scoreClassFqn; - public final MethodMatcher methodMatcher; - public final String methodName; - - public MatcherMeta(String select, String method) { - String className; - switch (select) { - case "Score": - case "IBendableScore": - className = "org.optaplanner.core.api.score." + select; - break; - default: - className = "org.optaplanner.core.api.score.buildin." - + select.toLowerCase().replace("score", "") - + "." - + select; - } - this.scoreClassFqn = className; - this.methodMatcher = new MethodMatcher(scoreClassFqn + " " + method); - this.methodName = method; - } - } - -} diff --git a/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/ScoreManagerMethodsRecipe.java b/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/ScoreManagerMethodsRecipe.java deleted file mode 100644 index a0d46ccf4ec..00000000000 --- a/optaplanner-migration/src/main/java/org/optaplanner/migration/v8/ScoreManagerMethodsRecipe.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.v8; - -import java.util.Arrays; -import java.util.List; - -import org.openrewrite.ExecutionContext; -import org.openrewrite.Recipe; -import org.openrewrite.TreeVisitor; -import org.openrewrite.java.JavaIsoVisitor; -import org.openrewrite.java.JavaParser; -import org.openrewrite.java.JavaTemplate; -import org.openrewrite.java.MethodMatcher; -import org.openrewrite.java.search.UsesMethod; -import org.openrewrite.java.tree.Expression; -import org.openrewrite.java.tree.J; - -public class ScoreManagerMethodsRecipe extends Recipe { - - private static final MatcherMeta[] MATCHER_METAS = { - new MatcherMeta("getSummary(..)"), - new MatcherMeta("explainScore(..)"), - new MatcherMeta("updateScore(..)") - }; - - @Override - public String getDisplayName() { - return "ScoreManager: explain(), update()"; - } - - @Override - public String getDescription() { - return "Use `explain()` and `update()` " + - " instead of `explainScore()`, `updateScore()` and `getSummary()`."; - } - - @Override - protected TreeVisitor getSingleSourceApplicableTest() { - return new JavaIsoVisitor<>() { - @Override - public J.CompilationUnit visitCompilationUnit(J.CompilationUnit compilationUnit, - ExecutionContext executionContext) { - for (MatcherMeta matcherMeta : MATCHER_METAS) { - doAfterVisit(new UsesMethod<>(matcherMeta.methodMatcher)); - } - return compilationUnit; - } - }; - } - - @Override - protected TreeVisitor getVisitor() { - return new JavaIsoVisitor<>() { - - @Override - public Expression visitExpression(Expression expression, ExecutionContext executionContext) { - final Expression e = super.visitExpression(expression, executionContext); - - MatcherMeta matcherMeta = Arrays.stream(MATCHER_METAS).filter(m -> m.methodMatcher.matches(e)) - .findFirst().orElse(null); - if (matcherMeta == null) { - return e; - } - J.MethodInvocation mi = (J.MethodInvocation) e; - Expression select = mi.getSelect(); - List arguments = mi.getArguments(); - String pattern = "#{any(" + matcherMeta.classFqn + ")}." + - (matcherMeta.methodName.contains("Summary") - ? "explain(#{any()}, SolutionUpdatePolicy.UPDATE_SCORE_ONLY).getSummary()" - : matcherMeta.methodName.replace(")", ", SolutionUpdatePolicy.UPDATE_SCORE_ONLY)") - .replace("..", "#{any()}") - .replace("Score(", "(")); - maybeAddImport("org.optaplanner.core.api.solver.SolutionUpdatePolicy"); - JavaTemplate template = JavaTemplate.builder(() -> getCursor().getParentOrThrow(), pattern) - .javaParser(() -> buildJavaParser().build()) - .imports("org.optaplanner.core.api.solver.SolutionUpdatePolicy") - .build(); - return e.withTemplate(template, e.getCoordinates().replace(), select, arguments.get(0)); - } - }; - } - - public static JavaParser.Builder buildJavaParser() { - return JavaParser.fromJavaVersion().classpath("optaplanner-core-impl"); - } - - private static final class MatcherMeta { - - public final String classFqn; - public final MethodMatcher methodMatcher; - public final String methodName; - - public MatcherMeta(String method) { - this.classFqn = "org.optaplanner.core.api.score.ScoreManager"; - this.methodMatcher = new MethodMatcher(classFqn + " " + method); - this.methodName = method; - } - } - -} diff --git a/optaplanner-migration/src/main/resources/META-INF/rewrite/ToLatest.yml b/optaplanner-migration/src/main/resources/META-INF/rewrite/ToLatest.yml deleted file mode 100644 index 9a35c2eda87..00000000000 --- a/optaplanner-migration/src/main/resources/META-INF/rewrite/ToLatest.yml +++ /dev/null @@ -1,21 +0,0 @@ -type: specs.openrewrite.org/v1beta/recipe -name: org.optaplanner.migration.ToLatest -displayName: Upgrade to the latest OptaPlanner -description: 'Replace all your calls to deleted/deprecated types and methods of OptaPlanner with their proper alternatives.' -recipeList: - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: optaplanner.solver.solve-length - newPropertyKey: optaplanner.solver.solve.duration - fileMatcher: '**/application.properties' - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.optaplanner.solver.solve-length - newPropertyKey: quarkus.optaplanner.solver.solve.duration - fileMatcher: '**/application.properties' - - org.optaplanner.migration.v8.ScoreManagerMethodsRecipe - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: org.optaplanner.core.api.score.ScoreManager - newFullyQualifiedTypeName: org.optaplanner.core.api.solver.SolutionManager - ignoreDefinition: true - - org.optaplanner.migration.v8.AsConstraintRecipe - - org.optaplanner.migration.v8.ScoreGettersRecipe - - org.openrewrite.java.RemoveUnusedImports diff --git a/optaplanner-migration/src/main/resources/META-INF/rewrite/ToLatest9.yml b/optaplanner-migration/src/main/resources/META-INF/rewrite/ToLatest9.yml deleted file mode 100644 index c7c536e1424..00000000000 --- a/optaplanner-migration/src/main/resources/META-INF/rewrite/ToLatest9.yml +++ /dev/null @@ -1,3439 +0,0 @@ -type: specs.openrewrite.org/v1beta/recipe -name: org.optaplanner.migration.ToLatest9 -displayName: Upgrade to the latest OptaPlanner 9 -description: 'Upgrade to the latest OptaPlanner 9 and migrate to Jakarta packages.' -recipeList: - - org.optaplanner.migration.ToLatest - - io.quarkus.updates.core.quarkus30.Quarkus3 - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: org.optaplanner - artifactId: optaplanner-bom - newVersion: 9.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: org.optaplanner - artifactId: optaplanner-quarkus - newVersion: 9.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: org.optaplanner - artifactId: optaplanner-core - newVersion: 9.x -##### -# Rules coming from https://github.com/quarkusio/jbang-catalog/blob/main/quarkus3.yml -##### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.Quarkus3 -displayName: Migrate project to Quarkus 3 -description: Update Quarkus version and migrate to Jakarta -tags: - - quarkus - - jakarta -recipeList: - - org.openrewrite.maven.ChangePropertyValue: - key: quarkus.platform.version - newValue: 3.0.0.Final - - org.openrewrite.maven.ChangePropertyValue: - key: quarkus.version - newValue: 3.0.0.Final - - org.openrewrite.maven.ChangePropertyValue: - key: version.io.quarkus - newValue: 3.0.0.Final - - org.openrewrite.java.migrate.jakarta.JavaxActivationMigrationToJakartaActivation - - org.openrewrite.java.migrate.jakarta.JavaxAnnotationMigrationToJakartaAnnotation - - org.openrewrite.java.migrate.jakarta.ChangeJavaxAnnotationToJakarta - - org.openrewrite.java.migrate.jakarta.JavaxAnnotationPackageToJakarta - - org.openrewrite.java.migrate.jakarta.JavaxAnnotationSecurityPackageToJakarta - - org.openrewrite.java.migrate.jakarta.JavaxAnnotationSqlPackageToJakarta - - org.openrewrite.java.migrate.jakarta.JavaxAuthenticationMigrationToJakartaAuthentication - - org.openrewrite.java.migrate.jakarta.JavaxAuthorizationMigrationToJakartaAuthorization - - org.openrewrite.java.migrate.jakarta.JavaxBatchMigrationToJakartaBatch - - org.openrewrite.java.migrate.jakarta.JavaxValidationMigrationToJakartaValidation - - org.openrewrite.java.migrate.jakarta.JavaxDecoratorToJakartaDecorator - - org.openrewrite.java.migrate.jakarta.JavaxEjbToJakartaEjb - - org.openrewrite.java.migrate.jakarta.JavaxElToJakartaEl - - org.openrewrite.java.migrate.jakarta.JavaxEnterpriseToJakartaEnterprise - - org.openrewrite.java.migrate.jakarta.JavaxFacesToJakartaFaces - - org.openrewrite.java.migrate.jakarta.JavaxInjectMigrationToJakartaInject - - org.openrewrite.java.migrate.jakarta.JavaxInterceptorToJakartaInterceptor - - org.openrewrite.java.migrate.jakarta.JavaxJmsToJakartaJms - - org.openrewrite.java.migrate.jakarta.JavaxJsonToJakartaJson - - org.openrewrite.java.migrate.jakarta.JavaxJwsToJakartaJws - - org.openrewrite.java.migrate.jakarta.JavaxMailToJakartaMail - - org.openrewrite.java.migrate.jakarta.JavaxPersistenceToJakartaPersistence - - org.openrewrite.java.migrate.jakarta.JavaxResourceToJakartaResource - - org.openrewrite.java.migrate.jakarta.JavaxSecurityToJakartaSecurity - - org.openrewrite.java.migrate.jakarta.JavaxServletToJakartaServlet - - org.openrewrite.java.migrate.jakarta.JavaxTransactionMigrationToJakartaTransaction - - org.openrewrite.java.migrate.jakarta.JavaxWebsocketToJakartaWebsocket - - org.openrewrite.java.migrate.jakarta.JavaxWsToJakartaWs - - org.openrewrite.java.migrate.jakarta.JavaxXmlBindMigrationToJakartaXmlBind - - org.openrewrite.java.migrate.jakarta.JavaxXmlSoapToJakartaXmlSoap - - org.openrewrite.java.migrate.jakarta.JavaxXmlWsMigrationToJakartaXmlWs - - org.openrewrite.java.migrate.jakarta.JavaxPersistenceXmlToJakartaPersistenceXml - - org.openrewrite.java.migrate.jakarta.JacksonJavaxToJakarta - - org.openrewrite.java.migrate.jakarta.RestAssuredJavaxToJakarta - - io.quarkus.updates.core.quarkus30.JavaxToJakartaAdditionalMigration - - io.quarkus.updates.core.quarkus30.AdditionalChanges - - io.quarkus.updates.core.quarkus30.ApplicationProperties - - io.quarkus.updates.core.quarkus30.ApplicationYml - - io.quarkus.updates.core.quarkus30.ApplicationYaml - - io.quarkus.updates.core.quarkus30.UpgradeQuarkiverse - - io.quarkus.updates.core.quarkus30.RenameJavaxServiceFiles - - io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationAdoc - - io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationMd - - io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestarts - - io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestartsTests - - io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlin ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.UpgradeQuarkiverse -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkus.bot - artifactId: 'build-reporter-*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.vault - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.amazonservices - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.cxf - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.jsch - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.jberet - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.artemis - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.config - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.freemarker - artifactId: '*' - newVersion: 1.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.githubapp - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.mybatis - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.messaginghub - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.prettytime - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.xmlsec - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.jef - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.githubaction - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.hibernatesearchextras - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.jackson-jq - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.jdbc - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.microprofile - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.minio - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.pact - artifactId: '*' - newVersion: 1.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.poi - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.primefaces - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.reactivemessaging.http - artifactId: '*' - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.renarde - artifactId: '*' - newVersion: 3.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.quarkiverse.shardingsphere - artifactId: '*' - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxActivationMigrationToJakartaActivation -displayName: Migrate deprecated `javax.activation` packages to `jakarta.activation` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - activation - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.activation - artifactId: jakarta.activation-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.activation - newPackageName: jakarta.activation - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.activation - oldArtifactId: javax.activation-api - newGroupId: jakarta.activation - newArtifactId: jakarta.activation-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxAnnotationMigrationToJakartaAnnotation -displayName: Migrate deprecated `javax.annotation` packages to `jakarta.annotation` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - annotation - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.annotation - artifactId: jakarta.annotation-api - newVersion: 2.x - - org.openrewrite.java.migrate.jakarta.ChangeJavaxAnnotationToJakarta - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.annotation - oldArtifactId: javax.annotation-api - newGroupId: jakarta.annotation - newArtifactId: jakarta.annotation-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.ChangeJavaxAnnotationToJakarta -displayName: Migrate deprecated `javax.annotation` packages to `jakarta.annotation` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. Excludes `javax.annotation.processing`. -tags: - - batch - - javax - - jakarta - -recipeList: - - org.openrewrite.java.migrate.jakarta.JavaxAnnotationPackageToJakarta - - org.openrewrite.java.migrate.jakarta.JavaxAnnotationSecurityPackageToJakarta - - org.openrewrite.java.migrate.jakarta.JavaxAnnotationSqlPackageToJakarta - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxAnnotationPackageToJakarta -displayName: Migrate deprecated `javax.annotation` packages to `jakarta.annotation` -description: Change type of classes in the `javax.annotation` package to jakarta. -tags: - - batch - - javax - - jakarta - -recipeList: - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.Generated - newFullyQualifiedTypeName: jakarta.annotation.Generated - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.ManagedBean - newFullyQualifiedTypeName: jakarta.annotation.ManagedBean - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.PostConstruct - newFullyQualifiedTypeName: jakarta.annotation.PostConstruct - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.PreDestroy - newFullyQualifiedTypeName: jakarta.annotation.PreDestroy - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.Priority - newFullyQualifiedTypeName: jakarta.annotation.Priority - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.Resource - newFullyQualifiedTypeName: jakarta.annotation.Resource - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.Resources - newFullyQualifiedTypeName: jakarta.annotation.Resources - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxAnnotationSecurityPackageToJakarta -displayName: Migrate deprecated `javax.annotation.security` packages to `jakarta.annotation.security` -description: Change type of classes in the `javax.annotation.security` package to jakarta. -tags: - - batch - - javax - - jakarta - -recipeList: - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.security.DeclareRoles - newFullyQualifiedTypeName: jakarta.annotation.security.DeclareRoles - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.security.DenyAll - newFullyQualifiedTypeName: jakarta.annotation.security.DenyAll - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.security.PermitAll - newFullyQualifiedTypeName: jakarta.annotation.security.PermitAll - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.security.RolesAllowed - newFullyQualifiedTypeName: jakarta.annotation.security.RolesAllowed - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.security.RunAs - newFullyQualifiedTypeName: jakarta.annotation.security.RunAs - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxAnnotationSqlPackageToJakarta -displayName: Migrate deprecated `javax.annotation.sql` packages to `jakarta.annotation.sql` -description: Change type of classes in the `javax.annotation.sql` package to jakarta. -tags: - - batch - - javax - - jakarta - -recipeList: - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.sql.DataSourceDefinition - newFullyQualifiedTypeName: jakarta.annotation.sql.DataSourceDefinition - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: javax.annotation.sql.DataSourceDefinitions - newFullyQualifiedTypeName: jakarta.annotation.sql.DataSourceDefinitions - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxAuthenticationMigrationToJakartaAuthentication -displayName: Migrate deprecated `javax.security.auth.message` packages to `jakarta.security.auth.message` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - authentication - - security - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.authorization - artifactId: jakarta.authorization-api - newVersion: 2.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.authentication - artifactId: jakarta.authentication-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.security.auth.message - newPackageName: jakarta.security.auth.message - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.security.auth.message - oldArtifactId: javax.security.auth.message-api - newGroupId: jakarta.authentication - newArtifactId: jakarta.authentication-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxAuthorizationMigrationToJakartaAuthorization -displayName: Migrate deprecated `javax.security.jacc` packages to `jakarta.security.jacc` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - authorization - - security - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.authorization - artifactId: jakarta.authorization-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.security.jacc - newPackageName: jakarta.security.jacc - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.security.jacc - oldArtifactId: javax.security.jacc-api - newGroupId: jakarta.authorization - newArtifactId: jakarta.authorization-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxBatchMigrationToJakartaBatch -displayName: Migrate deprecated `javax.batch` packages to `jakarta.batch` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - batch - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.batch - artifactId: jakarta.batch-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.batch - newPackageName: jakarta.batch - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.batch - oldArtifactId: javax.batch-api - newGroupId: jakarta.batch - newArtifactId: jakarta.batch-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxValidationMigrationToJakartaValidation -displayName: Migrate deprecated `javax.validation` packages to `jakarta.validation` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - validation - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.validation - artifactId: jakarta.validation-api - newVersion: 3.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.validation - newPackageName: jakarta.validation - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.validation - oldArtifactId: validation-api - newGroupId: jakarta.validation - newArtifactId: jakarta.validation-api - newVersion: 3.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxDecoratorToJakartaDecorator -displayName: Migrate deprecated `javax.decorator` packages to `jakarta.decorator` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.enterprise - artifactId: jakarta.enterprise.cdi-api - newVersion: 4.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.decorator - newPackageName: jakarta.decorator - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.enterprise - oldArtifactId: cdi-api - newGroupId: jakarta.enterprise - newArtifactId: jakarta.enterprise.cdi-api - newVersion: 4.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxEjbToJakartaEjb -displayName: Migrate deprecated `javax.ejb` packages to `jakarta.ejb` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.ejb - artifactId: jakarta.ejb-api - newVersion: 4.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.ejb - newPackageName: jakarta.ejb - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.ejb - oldArtifactId: javax.ejb-api - newGroupId: jakarta.ejb - newArtifactId: jakarta.ejb-api - newVersion: 4.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxElToJakartaEl -displayName: Migrate deprecated `javax.el` packages to `jakarta.el` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.el - artifactId: jakarta.el-api - newVersion: 4.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.el - newPackageName: jakarta.el - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.el - oldArtifactId: javax.el-api - newGroupId: jakarta.el - newArtifactId: jakarta.el-api - newVersion: 4.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxEnterpriseToJakartaEnterprise -displayName: Migrate deprecated `javax.enterprise` packages to `jakarta.enterprise` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.enterprise - artifactId: jakarta.enterprise.cdi-api - newVersion: 4.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.enterprise - newPackageName: jakarta.enterprise - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.enterprise - oldArtifactId: cdi-api - newGroupId: jakarta.enterprise - newArtifactId: jakarta.enterprise.cdi-api - newVersion: 4.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxFacesToJakartaFaces -displayName: Migrate deprecated `javax.faces` packages to `jakarta.faces` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.faces - artifactId: jakarta.faces-api - newVersion: 4.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.faces - newPackageName: jakarta.faces - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.faces - oldArtifactId: javax.faces-api - newGroupId: jakarta.faces - newArtifactId: jakarta.faces-api - newVersion: 4.x - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - groupId: org.glassfish - artifactId: javax.faces - newGroupId: org.glassfish - newArtifactId: jakarta.faces - newVersion: 4.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxInjectMigrationToJakartaInject -displayName: Migrate deprecated `javax.inject` packages to `jakarta.inject` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - inject - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.inject - artifactId: jakarta.inject-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.inject - newPackageName: jakarta.inject - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.inject - oldArtifactId: javax.inject-api - newGroupId: jakarta.inject - newArtifactId: jakarta.inject-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxInterceptorToJakartaInterceptor -displayName: Migrate deprecated `javax.interceptor` packages to `jakarta.interceptor` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.interceptor - artifactId: jakarta.interceptor-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.interceptor - newPackageName: jakarta.interceptor - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.interceptor - oldArtifactId: javax.interceptor-api - newGroupId: jakarta.interceptor - newArtifactId: jakarta.interceptor-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxJmsToJakartaJms -displayName: Migrate deprecated `javax.jms` packages to `jakarta.jms` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.jms - artifactId: jakarta.jms-api - newVersion: 3.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.jms - newPackageName: jakarta.jms - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.jms - oldArtifactId: javax.jms-api - newGroupId: jakarta.jms - newArtifactId: jakarta.jms-api - newVersion: 3.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxJsonToJakartaJson -displayName: Migrate deprecated `javax.json` packages to `jakarta.json` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.json - artifactId: jakarta.json-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.json - newPackageName: jakarta.json - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.json - oldArtifactId: javax.json-api - newGroupId: jakarta.json - newArtifactId: jakarta.json-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxJwsToJakartaJws -displayName: Migrate deprecated `javax.jws` packages to `jakarta.jws` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.jws - artifactId: jakarta.jws-api - newVersion: 3.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.jws - newPackageName: jakarta.jws - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.jws - oldArtifactId: javax.jws-api - newGroupId: jakarta.jws - newArtifactId: jakarta.jws-api - newVersion: 3.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxMailToJakartaMail -displayName: Migrate deprecated `javax.mail` packages to `jakarta.mail` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.mail - artifactId: jakarta.mail-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.mail - newPackageName: jakarta.mail - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.mail - oldArtifactId: javax.mail-api - newGroupId: jakarta.mail - newArtifactId: jakarta.mail-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxPersistenceToJakartaPersistence -displayName: Migrate deprecated `javax.persistence` packages to `jakarta.persistence` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.persistence - artifactId: jakarta.persistence-api - # TODO upgrade this to 3.x once we have Hibernate ORM 6 - newVersion: 3.0.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.persistence - newPackageName: jakarta.persistence - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.persistence - oldArtifactId: javax.persistence - newGroupId: jakarta.persistence - newArtifactId: jakarta.persistence-api - # TODO upgrade this to 3.x once we have Hibernate ORM 6 - newVersion: 3.0.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxResourceToJakartaResource -displayName: Migrate deprecated `javax.resource` packages to `jakarta.resource` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.resource - artifactId: jakarta.resource-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.resource - newPackageName: jakarta.resource - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.resource - oldArtifactId: javax.resource-api - newGroupId: jakarta.resource - newArtifactId: jakarta.resource-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxSecurityToJakartaSecurity -displayName: Migrate deprecated `javax.security.enterprise` packages to `jakarta.security.enterprise` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.security.enterprise - artifactId: jakarta.security.enterprise-api - newVersion: 3.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.security.enterprise - newPackageName: jakarta.security.enterprise - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.security.enterprise - oldArtifactId: javax.security.enterprise-api - newGroupId: jakarta.security.enterprise - newArtifactId: jakarta.security.enterprise-api - newVersion: 3.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxServletToJakartaServlet -displayName: Migrate deprecated `javax.servlet` packages to `jakarta.servlet` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.servlet - artifactId: jakarta.servlet-api - newVersion: 6.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.servlet - newPackageName: jakarta.servlet - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.servlet - oldArtifactId: javax.servlet-api - newGroupId: jakarta.servlet - newArtifactId: jakarta.servlet-api - newVersion: 6.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxTransactionMigrationToJakartaTransaction -displayName: Migrate deprecated `javax.transaction` packages to `jakarta.transaction` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - transaction - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.transaction - artifactId: jakarta.transaction-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.transaction - newPackageName: jakarta.transaction - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.transaction - oldArtifactId: javax.transaction-api - newGroupId: jakarta.transaction - newArtifactId: jakarta.transaction-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxWebsocketToJakartaWebsocket -displayName: Migrate deprecated `javax.websocket` packages to `jakarta.websocket` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.websocket - artifactId: jakarta.websocket-api - newVersion: 2.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.websocket - newPackageName: jakarta.websocket - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.websocket - oldArtifactId: javax.websocket-api - newGroupId: jakarta.websocket - newArtifactId: jakarta.websocket-api - newVersion: 2.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxWsToJakartaWs -displayName: Migrate deprecated `javax.ws` packages to `jakarta.ws` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.ws.rs - artifactId: jakarta.ws.rs-api - newVersion: 3.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.ws - newPackageName: jakarta.ws - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.ws.rs - oldArtifactId: javax.ws.rs-api - newGroupId: jakarta.ws.rs - newArtifactId: jakarta.ws.rs-api - newVersion: 3.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxXmlBindMigrationToJakartaXmlBind -displayName: Migrate deprecated `javax.xml.bind` packages to `jakarta.xml.bind` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - jaxb - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.xml.bind - artifactId: jakarta.xml.bind-api - newVersion: 4.x - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: org.glassfish.jaxb - artifactId: jaxb-runtime - newVersion: 4.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.xml.bind - newPackageName: jakarta.xml.bind - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.xml.bind - oldArtifactId: jaxb-api - newGroupId: jakarta.xml.bind - newArtifactId: jakarta.xml.bind-api - newVersion: 4.x - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.sun.xml.bind - oldArtifactId: jaxb-impl - newGroupId: org.glassfish.jaxb - newArtifactId: jaxb-runtime - newVersion: 4.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxXmlSoapToJakartaXmlSoap -displayName: Migrate deprecated `javax.soap` packages to `jakarta.soap` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.xml.soap - artifactId: jakarta.xml.soap-api - newVersion: 3.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.xml.soap - newPackageName: jakarta.xml.soap - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.xml.soap - oldArtifactId: javax.xml.soap-api - newGroupId: jakarta.xml.soap - newArtifactId: jakarta.xml.soap-api - newVersion: 3.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxXmlWsMigrationToJakartaXmlWs -displayName: Migrate deprecated `javax.xml.ws` packages to `jakarta.xml.ws` -description: Java EE has been rebranded to Jakarta EE, necessitating a package relocation. -tags: - - jaxws - - javax - - jakarta - -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: jakarta.xml.ws - artifactId: jakarta.xml.ws-api - newVersion: 4.x - - org.openrewrite.java.ChangePackage: - oldPackageName: javax.xml.ws - newPackageName: jakarta.xml.ws - recursive: true - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: javax.xml.ws - oldArtifactId: jaxws-api - newGroupId: jakarta.xml.ws - newArtifactId: jakarta.xml.ws-api - newVersion: 4.x - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JavaxPersistenceXmlToJakartaPersistenceXml -displayName: Migrate xmlns entries in `persistence.xml` files -description: Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation. - -recipeList: - # TODO upgrade for JPA 3.1 - - org.openrewrite.xml.ChangeTagAttribute: - attributeName: name - elementName: //property - oldValue: javax.persistence - newValue: jakarta.persistence - fileMatcher: "**/persistence.xml" - - org.openrewrite.xml.ChangeTagAttribute: - attributeName: version - elementName: persistence - newValue: 3.0 - fileMatcher: "**/persistence.xml" - - org.openrewrite.xml.ChangeTagAttribute: - attributeName: xmlns - elementName: persistence - oldValue: http://xmlns.jcp.org - newValue: https://jakarta.ee - fileMatcher: "**/persistence.xml" - - org.openrewrite.xml.ChangeTagAttribute: - attributeName: xsi:schemaLocation - elementName: persistence - newValue: https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd - fileMatcher: "**/persistence.xml" - ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.JacksonJavaxToJakarta -displayName: Migrate Jackson from javax to jakarta namespace -description: > - Java EE has been rebranded to Jakarta EE. This recipe replaces existing Jackson dependencies with their counterparts - that are compatible with Jakarta EE. - -recipeList: - # JAXB annotations support - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.module - oldArtifactId: jackson-module-jaxb-annotations - newGroupId: com.fasterxml.jackson.module - newArtifactId: jackson-module-jakarta-xmlbind-annotations - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.module - oldArtifactId: jackson-module-jaxb-annotations - newGroupId: com.fasterxml.jackson.module - newArtifactId: jackson-module-jakarta-xmlbind-annotations - # JAXRS providers - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-cbor-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-cbor-provider - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-cbor-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-cbor-provider - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-json-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-json-provider - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-json-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-json-provider - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-smile-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-smile-provider - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-smile-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-smile-provider - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-xml-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-xml-provider - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-xml-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-xml-provider - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-yaml-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-yaml-provider - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.jaxrs - oldArtifactId: jackson-jaxrs-yaml-provider - newGroupId: com.fasterxml.jackson.jakarta.rs - newArtifactId: jackson-jakarta-rs-yaml-provider - # JSONP datatypes - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.datatype - oldArtifactId: jackson-datatype-jsr353 - newGroupId: com.fasterxml.jackson.datatype - newArtifactId: jackson-datatype-jakarta-jsonp - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: com.fasterxml.jackson.datatype - oldArtifactId: jackson-datatype-jsr353 - newGroupId: com.fasterxml.jackson.datatype - newArtifactId: jackson-datatype-jakarta-jsonp - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.glassfish - oldArtifactId: javax.json - newGroupId: org.eclipse.parsson - newArtifactId: parsson - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: org.glassfish - oldArtifactId: javax.json - newGroupId: org.eclipse.parsson - newArtifactId: parsson - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.glassfish - oldArtifactId: jakarta.json - newGroupId: org.eclipse.parsson - newArtifactId: parsson - - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: - oldGroupId: org.glassfish - oldArtifactId: jakarta.json - newGroupId: org.eclipse.parsson - newArtifactId: parsson - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: com.fasterxml.jackson.datatype.jsr353.JSR353Module - newFullyQualifiedTypeName: com.fasterxml.jackson.datatype.jsonp.JSONPModule - - org.openrewrite.java.ChangePackage: - oldPackageName: com.fasterxml.jackson.jaxrs - newPackageName: com.fasterxml.jackson.jakarta.rs - recursive: true - ---- -# Currently this recipe is only updating the artifacts to a version that is compatible with J2EE 9. There still may be -# breaking changes to the Rest Assured API that need to be addressed. -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.jakarta.RestAssuredJavaxToJakarta -displayName: Migrate RestAssured from javax to jakarta namespace by upgrading to a version compatible with J2EE9 -description: > - Java EE has been rebranded to Jakarta EE. This recipe replaces existing RestAssured dependencies with their - counterparts that are compatible with Jakarta EE. -recipeList: - - org.openrewrite.maven.UpgradeDependencyVersion: - groupId: io.rest-assured - artifactId: "*" - newVersion: 5.x -##### -# Additional rules coming from our Quarkus Jakarta migration and feedback from the field -##### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.JavaxToJakartaAdditionalMigration -recipeList: - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.glassfish - oldArtifactId: jakarta.el - newGroupId: org.glassfish.expressly - newArtifactId: expressly - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-core - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-envers - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-jpamodelgen - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-spatial - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-testing - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-micrometer - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-jcache - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-infinispan - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: hibernate-ehcache - newGroupId: org.hibernate.orm - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate.search - oldArtifactId: hibernate-search-mapper-orm-coordination-outbox-polling - newGroupId: org.hibernate.search - newArtifactId: hibernate-search-mapper-orm-coordination-outbox-polling-jakarta - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate.search - oldArtifactId: hibernate-search-mapper-orm - newGroupId: org.hibernate.search - newArtifactId: hibernate-search-mapper-orm-jakarta - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.hibernate - oldArtifactId: quarkus-local-cache - newGroupId: org.hibernate - newArtifactId: quarkus-local-cache-jakarta - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.jboss.spec.javax.ws.rs - oldArtifactId: jboss-jaxrs-api_2.1_spec - newGroupId: jakarta.ws.rs - newArtifactId: jakarta.ws.rs-api - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.jboss.spec.javax.xml.bind - oldArtifactId: jboss-jaxb-api_2.3_spec - newGroupId: jakarta.xml.bind - newArtifactId: jakarta.xml.bind-api - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.jboss.spec.javax.transaction - oldArtifactId: jboss-transaction-api_1.3_spec - newGroupId: jakarta.transaction - newArtifactId: jakarta.transaction-api - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.sun.activation - oldArtifactId: jakarta.activation - newGroupId: org.eclipse.angus - newArtifactId: angus-activation - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: com.sun.activation - oldArtifactId: javax.activation - newGroupId: org.eclipse.angus - newArtifactId: angus-activation - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.jboss.spec.javax.ejb - oldArtifactId: jboss-ejb-api_3.1_spec - newGroupId: jakarta.ejb - newArtifactId: jakarta.ejb-api - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.keycloak - oldArtifactId: keycloak-admin-client - newGroupId: org.keycloak - newArtifactId: keycloak-admin-client-jakarta - - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId: - oldGroupId: org.keycloak - oldArtifactId: keycloak-admin-client - newGroupId: org.keycloak - newArtifactId: keycloak-admin-client-jakarta -# Commented for now as OpenRewrite doesn't reload the model and adds the exclusions -# even when the artifacts are not transitive dependencies in Quarkus 3 -# - org.openrewrite.maven.ExcludeDependency: -# groupId: com.sun.activation -# artifactId: jakarta.activation -# - org.openrewrite.maven.ExcludeDependency: -# groupId: com.sun.activation -# artifactId: javax.activation -# - org.openrewrite.maven.ExcludeDependency: -# groupId: org.glassfish -# artifactId: jakarta.el - -#### -# Rename javax service files -#### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.RenameJavaxServiceFiles -displayName: Rename a file example -recipeList: - - org.openrewrite.RenameFile: - fileMatcher: '**/META-INF/services/javax.ws.rs.ext.Providers' - fileName: jakarta.ws.rs.ext.Providers - - org.openrewrite.RenameFile: - fileMatcher: '**/META-INF/services/javax.ws.rs.client.ClientBuilder' - fileName: jakarta.ws.rs.client.ClientBuilder - - org.openrewrite.RenameFile: - fileMatcher: '**/META-INF/services/javax.ws.rs.sse.SseEventSource$Builder' - fileName: jakarta.ws.rs.sse.SseEventSource$Builder - -##### -# Additional recipes for Quarkus 3 not related to the Jakarta migration -##### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.AdditionalChanges -recipeList: - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: org.jboss.resteasy.reactive.server.core.multipart.MultipartFormDataOutput - newFullyQualifiedTypeName: org.jboss.resteasy.reactive.server.multipart.MultipartFormDataOutput - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: org.jboss.resteasy.reactive.server.core.multipart.PartItem - newFullyQualifiedTypeName: org.jboss.resteasy.reactive.server.multipart.PartItem - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: org.jboss.resteasy.reactive.server.core.multipart.FormData.FormValue - newFullyQualifiedTypeName: org.jboss.resteasy.reactive.server.multipart.FormValue - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: io.quarkus.test.junit.NativeImageTest - newFullyQualifiedTypeName: io.quarkus.test.junit.QuarkusIntegrationTest - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: io.quarkus.test.junit.DisabledOnNativeImage - newFullyQualifiedTypeName: io.quarkus.test.junit.DisabledOnIntegrationTest - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: org.jboss.resteasy.reactive.MultipartForm - newFullyQualifiedTypeName: jakarta.ws.rs.BeanParam - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: io.smallrye.reactive.messaging.providers.connectors.InMemoryConnector - newFullyQualifiedTypeName: io.smallrye.reactive.messaging.memory.InMemoryConnector - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: io.quarkus.hibernate.reactive.panache.common.runtime.ReactiveTransactional - newFullyQualifiedTypeName: io.quarkus.hibernate.reactive.panache.common.WithTransaction - - org.openrewrite.java.ChangeType: - oldFullyQualifiedTypeName: io.quarkus.arc.Priority - newFullyQualifiedTypeName: jakarta.annotation.Priority - - org.openrewrite.text.FindAndReplace: - find: quarkus-bootstrap-maven-plugin - replace: quarkus-extension-maven-plugin - fileMatcher: '**/pom.xml' - -##### -# Adjust properties in application.properties -##### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.ApplicationProperties -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/application*.properties" -recipeList: - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.expose - newPropertyKey: quarkus.kubernetes.ingress.expose - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.expose - newPropertyKey: quarkus.openshift.route.expose - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.host - newPropertyKey: quarkus.kubernetes.ingress.host - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.host - newPropertyKey: quarkus.openshift.route.host - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.group - newPropertyKey: quarkus.kubernetes.part-of - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.group - newPropertyKey: quarkus.openshift.part-of - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.jib.labels - newPropertyKey: quarkus.container-image.labels - -##### -# Adjust properties in application.yml -##### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.ApplicationYml -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/application*.yml" -recipeList: - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.expose - newPropertyKey: quarkus.kubernetes.ingress.expose - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.expose - newPropertyKey: quarkus.openshift.route.expose - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.host - newPropertyKey: quarkus.kubernetes.ingress.host - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.host - newPropertyKey: quarkus.openshift.route.host - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.group - newPropertyKey: quarkus.kubernetes.part-of - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.group - newPropertyKey: quarkus.openshift.part-of - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.jib.labels - newPropertyKey: quarkus.container-image.labels - -##### -# Adjust properties in application.yaml -##### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.ApplicationYaml -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/application*.yaml" -recipeList: - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.expose - newPropertyKey: quarkus.kubernetes.ingress.expose - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.expose - newPropertyKey: quarkus.openshift.route.expose - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.host - newPropertyKey: quarkus.kubernetes.ingress.host - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.host - newPropertyKey: quarkus.openshift.route.host - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.kubernetes.group - newPropertyKey: quarkus.kubernetes.part-of - - org.openrewrite.yaml.ChangePropertyKey: - oldPropertyKey: quarkus.openshift.group - newPropertyKey: quarkus.openshift.part-of - - org.openrewrite.properties.ChangePropertyKey: - oldPropertyKey: quarkus.jib.labels - newPropertyKey: quarkus.container-image.labels - -##### -# Generated by PropertiesToRecipe.java from jakarta-renames.properties -##### ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationAdoc -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/*.adoc" -recipeList: - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.config. - replace: jakarta.json.bind.config. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.soap. - replace: jakarta.xml.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.security.jacc. - replace: jakarta.security.jacc. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.internet. - replace: jakarta.mail.internet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk. - replace: jakarta.batch.api.chunk. - - org.openrewrite.text.FindAndReplace: - find: javax.json.spi. - replace: jakarta.json.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource. - replace: jakarta.resource. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.work. - replace: jakarta.resource.spi.work. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation.adapters. - replace: jakarta.xml.bind.annotation.adapters. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.webapp. - replace: jakarta.faces.webapp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.application. - replace: jakarta.faces.application. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.util. - replace: jakarta.xml.bind.util. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.criteria. - replace: jakarta.persistence.criteria. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.event. - replace: jakarta.faces.event. - - org.openrewrite.text.FindAndReplace: - find: javax.activation. - replace: jakarta.activation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow.builder. - replace: jakarta.faces.flow.builder. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket. - replace: jakarta.websocket. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.serializer. - replace: jakarta.json.bind.serializer. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.se. - replace: jakarta.enterprise.inject.se. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.cci. - replace: jakarta.resource.cci. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.spi. - replace: jakarta.validation.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.transaction. - replace: jakarta.transaction. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.attachment. - replace: jakarta.xml.bind.attachment. - - org.openrewrite.text.FindAndReplace: - find: javax.interceptor. - replace: jakarta.interceptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.helpers. - replace: jakarta.xml.bind.helpers. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.embeddable. - replace: jakarta.ejb.embeddable. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence. - replace: jakarta.persistence. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject. - replace: jakarta.enterprise.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.event. - replace: jakarta.mail.event. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.endpoint. - replace: jakarta.resource.spi.endpoint. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.visit. - replace: jakarta.faces.component.visit. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl. - replace: jakarta.servlet.jsp.jstl. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.el. - replace: jakarta.servlet.jsp.el. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.el. - replace: jakarta.faces.el. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind. - replace: jakarta.xml.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.adapter. - replace: jakarta.json.bind.adapter. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.valueextraction. - replace: jakarta.validation.valueextraction. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view.facelets. - replace: jakarta.faces.view.facelets. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow. - replace: jakarta.faces.flow. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.render. - replace: jakarta.faces.render. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.util. - replace: jakarta.mail.util. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime.context. - replace: jakarta.batch.runtime.context. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.security. - replace: jakarta.annotation.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component. - replace: jakarta.faces.component. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.fmt. - replace: jakarta.servlet.jsp.jstl.fmt. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.spi. - replace: jakarta.json.bind.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet. - replace: jakarta.servlet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.operations. - replace: jakarta.batch.operations. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.push. - replace: jakarta.faces.push. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.descriptor. - replace: jakarta.servlet.descriptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler.soap. - replace: jakarta.xml.ws.handler.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.executable. - replace: jakarta.validation.executable. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.behavior. - replace: jakarta.faces.component.behavior. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation. - replace: jakarta.xml.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime. - replace: jakarta.batch.runtime. - - org.openrewrite.text.FindAndReplace: - find: javax.json.stream. - replace: jakarta.json.stream. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.annotation. - replace: jakarta.servlet.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.resources. - replace: jakarta.servlet.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.http. - replace: jakarta.servlet.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi.http. - replace: jakarta.xml.ws.spi.http. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.container. - replace: jakarta.ws.rs.container. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws. - replace: jakarta.xml.ws. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.spi. - replace: jakarta.enterprise.context.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi. - replace: jakarta.resource.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.validator. - replace: jakarta.faces.validator. - - org.openrewrite.text.FindAndReplace: - find: javax.jws. - replace: jakarta.jws. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation. - replace: jakarta.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.search. - replace: jakarta.faces.component.search. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind. - replace: jakarta.json.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.tlv. - replace: jakarta.servlet.jsp.jstl.tlv. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.core. - replace: jakarta.servlet.jsp.jstl.core. - - org.openrewrite.text.FindAndReplace: - find: javax.decorator. - replace: jakarta.decorator. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.bean. - replace: jakarta.faces.bean. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.sse. - replace: jakarta.ws.rs.sse. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.metamodel. - replace: jakarta.persistence.metamodel. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context. - replace: jakarta.enterprise.context. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi. - replace: jakarta.xml.ws.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api. - replace: jakarta.batch.api. - - org.openrewrite.text.FindAndReplace: - find: javax.el. - replace: jakarta.el. - - org.openrewrite.text.FindAndReplace: - find: javax.json. - replace: jakarta.json. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk.listener. - replace: jakarta.batch.api.chunk.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.spi. - replace: jakarta.persistence.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler. - replace: jakarta.xml.ws.handler. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.sql. - replace: jakarta.servlet.jsp.jstl.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.literal. - replace: jakarta.enterprise.inject.literal. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.ext. - replace: jakarta.ws.rs.ext. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraints. - replace: jakarta.validation.constraints. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.resources. - replace: jakarta.servlet.jsp.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraintvalidation. - replace: jakarta.validation.constraintvalidation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.lifecycle. - replace: jakarta.faces.lifecycle. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.callback. - replace: jakarta.security.auth.message.callback. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs. - replace: jakarta.ws.rs. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.config. - replace: jakarta.security.auth.message.config. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket.server. - replace: jakarta.websocket.server. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.authentication.mechanism.http. - replace: jakarta.security.enterprise.authentication.mechanism.http. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.event. - replace: jakarta.enterprise.event. - - org.openrewrite.text.FindAndReplace: - find: javax.inject. - replace: jakarta.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.listener. - replace: jakarta.batch.api.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.http. - replace: jakarta.xml.ws.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.soap. - replace: jakarta.xml.ws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi. - replace: jakarta.enterprise.inject.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces. - replace: jakarta.faces. - - org.openrewrite.text.FindAndReplace: - find: javax.jms. - replace: jakarta.jms. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.wsaddressing. - replace: jakarta.xml.ws.wsaddressing. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.bootstrap. - replace: jakarta.validation.bootstrap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.spi. - replace: jakarta.ejb.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.metadata. - replace: jakarta.validation.metadata. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp. - replace: jakarta.servlet.jsp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.convert. - replace: jakarta.faces.convert. - - org.openrewrite.text.FindAndReplace: - find: javax.mail. - replace: jakarta.mail. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.concurrent. - replace: jakarta.enterprise.concurrent. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.partition. - replace: jakarta.batch.api.partition. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.html. - replace: jakarta.faces.component.html. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi.configurator. - replace: jakarta.enterprise.inject.spi.configurator. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.credential. - replace: jakarta.security.enterprise.credential. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.control. - replace: jakarta.enterprise.context.control. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.annotation. - replace: jakarta.json.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.search. - replace: jakarta.mail.search. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.util. - replace: jakarta.enterprise.util. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.client. - replace: jakarta.ws.rs.client. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.model. - replace: jakarta.faces.model. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.security. - replace: jakarta.resource.spi.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view. - replace: jakarta.faces.view. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise. - replace: jakarta.security.enterprise. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.tagext. - replace: jakarta.servlet.jsp.tagext. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.core. - replace: jakarta.ws.rs.core. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.module. - replace: jakarta.security.auth.message.module. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.context. - replace: jakarta.faces.context. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message. - replace: jakarta.security.auth.message. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.sql. - replace: jakarta.annotation.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.annotation. - replace: jakarta.faces.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.groups. - replace: jakarta.validation.groups. - - org.openrewrite.text.FindAndReplace: - find: javax.jws.soap. - replace: jakarta.jws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb. - replace: jakarta.ejb. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.identitystore. - replace: jakarta.security.enterprise.identitystore. - - org.openrewrite.text.FindAndReplace: - find: javax.validation. - replace: jakarta.validation. ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationMd -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/*.md" -recipeList: - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.config. - replace: jakarta.json.bind.config. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.soap. - replace: jakarta.xml.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.security.jacc. - replace: jakarta.security.jacc. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.internet. - replace: jakarta.mail.internet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk. - replace: jakarta.batch.api.chunk. - - org.openrewrite.text.FindAndReplace: - find: javax.json.spi. - replace: jakarta.json.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource. - replace: jakarta.resource. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.work. - replace: jakarta.resource.spi.work. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation.adapters. - replace: jakarta.xml.bind.annotation.adapters. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.webapp. - replace: jakarta.faces.webapp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.application. - replace: jakarta.faces.application. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.util. - replace: jakarta.xml.bind.util. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.criteria. - replace: jakarta.persistence.criteria. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.event. - replace: jakarta.faces.event. - - org.openrewrite.text.FindAndReplace: - find: javax.activation. - replace: jakarta.activation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow.builder. - replace: jakarta.faces.flow.builder. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket. - replace: jakarta.websocket. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.serializer. - replace: jakarta.json.bind.serializer. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.se. - replace: jakarta.enterprise.inject.se. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.cci. - replace: jakarta.resource.cci. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.spi. - replace: jakarta.validation.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.transaction. - replace: jakarta.transaction. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.attachment. - replace: jakarta.xml.bind.attachment. - - org.openrewrite.text.FindAndReplace: - find: javax.interceptor. - replace: jakarta.interceptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.helpers. - replace: jakarta.xml.bind.helpers. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.embeddable. - replace: jakarta.ejb.embeddable. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence. - replace: jakarta.persistence. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject. - replace: jakarta.enterprise.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.event. - replace: jakarta.mail.event. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.endpoint. - replace: jakarta.resource.spi.endpoint. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.visit. - replace: jakarta.faces.component.visit. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl. - replace: jakarta.servlet.jsp.jstl. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.el. - replace: jakarta.servlet.jsp.el. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.el. - replace: jakarta.faces.el. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind. - replace: jakarta.xml.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.adapter. - replace: jakarta.json.bind.adapter. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.valueextraction. - replace: jakarta.validation.valueextraction. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view.facelets. - replace: jakarta.faces.view.facelets. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow. - replace: jakarta.faces.flow. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.render. - replace: jakarta.faces.render. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.util. - replace: jakarta.mail.util. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime.context. - replace: jakarta.batch.runtime.context. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.security. - replace: jakarta.annotation.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component. - replace: jakarta.faces.component. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.fmt. - replace: jakarta.servlet.jsp.jstl.fmt. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.spi. - replace: jakarta.json.bind.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet. - replace: jakarta.servlet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.operations. - replace: jakarta.batch.operations. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.push. - replace: jakarta.faces.push. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.descriptor. - replace: jakarta.servlet.descriptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler.soap. - replace: jakarta.xml.ws.handler.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.executable. - replace: jakarta.validation.executable. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.behavior. - replace: jakarta.faces.component.behavior. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation. - replace: jakarta.xml.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime. - replace: jakarta.batch.runtime. - - org.openrewrite.text.FindAndReplace: - find: javax.json.stream. - replace: jakarta.json.stream. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.annotation. - replace: jakarta.servlet.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.resources. - replace: jakarta.servlet.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.http. - replace: jakarta.servlet.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi.http. - replace: jakarta.xml.ws.spi.http. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.container. - replace: jakarta.ws.rs.container. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws. - replace: jakarta.xml.ws. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.spi. - replace: jakarta.enterprise.context.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi. - replace: jakarta.resource.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.validator. - replace: jakarta.faces.validator. - - org.openrewrite.text.FindAndReplace: - find: javax.jws. - replace: jakarta.jws. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation. - replace: jakarta.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.search. - replace: jakarta.faces.component.search. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind. - replace: jakarta.json.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.tlv. - replace: jakarta.servlet.jsp.jstl.tlv. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.core. - replace: jakarta.servlet.jsp.jstl.core. - - org.openrewrite.text.FindAndReplace: - find: javax.decorator. - replace: jakarta.decorator. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.bean. - replace: jakarta.faces.bean. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.sse. - replace: jakarta.ws.rs.sse. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.metamodel. - replace: jakarta.persistence.metamodel. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context. - replace: jakarta.enterprise.context. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi. - replace: jakarta.xml.ws.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api. - replace: jakarta.batch.api. - - org.openrewrite.text.FindAndReplace: - find: javax.el. - replace: jakarta.el. - - org.openrewrite.text.FindAndReplace: - find: javax.json. - replace: jakarta.json. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk.listener. - replace: jakarta.batch.api.chunk.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.spi. - replace: jakarta.persistence.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler. - replace: jakarta.xml.ws.handler. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.sql. - replace: jakarta.servlet.jsp.jstl.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.literal. - replace: jakarta.enterprise.inject.literal. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.ext. - replace: jakarta.ws.rs.ext. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraints. - replace: jakarta.validation.constraints. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.resources. - replace: jakarta.servlet.jsp.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraintvalidation. - replace: jakarta.validation.constraintvalidation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.lifecycle. - replace: jakarta.faces.lifecycle. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.callback. - replace: jakarta.security.auth.message.callback. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs. - replace: jakarta.ws.rs. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.config. - replace: jakarta.security.auth.message.config. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket.server. - replace: jakarta.websocket.server. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.authentication.mechanism.http. - replace: jakarta.security.enterprise.authentication.mechanism.http. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.event. - replace: jakarta.enterprise.event. - - org.openrewrite.text.FindAndReplace: - find: javax.inject. - replace: jakarta.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.listener. - replace: jakarta.batch.api.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.http. - replace: jakarta.xml.ws.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.soap. - replace: jakarta.xml.ws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi. - replace: jakarta.enterprise.inject.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces. - replace: jakarta.faces. - - org.openrewrite.text.FindAndReplace: - find: javax.jms. - replace: jakarta.jms. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.wsaddressing. - replace: jakarta.xml.ws.wsaddressing. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.bootstrap. - replace: jakarta.validation.bootstrap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.spi. - replace: jakarta.ejb.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.metadata. - replace: jakarta.validation.metadata. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp. - replace: jakarta.servlet.jsp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.convert. - replace: jakarta.faces.convert. - - org.openrewrite.text.FindAndReplace: - find: javax.mail. - replace: jakarta.mail. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.concurrent. - replace: jakarta.enterprise.concurrent. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.partition. - replace: jakarta.batch.api.partition. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.html. - replace: jakarta.faces.component.html. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi.configurator. - replace: jakarta.enterprise.inject.spi.configurator. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.credential. - replace: jakarta.security.enterprise.credential. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.control. - replace: jakarta.enterprise.context.control. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.annotation. - replace: jakarta.json.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.search. - replace: jakarta.mail.search. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.util. - replace: jakarta.enterprise.util. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.client. - replace: jakarta.ws.rs.client. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.model. - replace: jakarta.faces.model. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.security. - replace: jakarta.resource.spi.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view. - replace: jakarta.faces.view. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise. - replace: jakarta.security.enterprise. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.tagext. - replace: jakarta.servlet.jsp.tagext. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.core. - replace: jakarta.ws.rs.core. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.module. - replace: jakarta.security.auth.message.module. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.context. - replace: jakarta.faces.context. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message. - replace: jakarta.security.auth.message. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.sql. - replace: jakarta.annotation.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.annotation. - replace: jakarta.faces.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.groups. - replace: jakarta.validation.groups. - - org.openrewrite.text.FindAndReplace: - find: javax.jws.soap. - replace: jakarta.jws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb. - replace: jakarta.ejb. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.identitystore. - replace: jakarta.security.enterprise.identitystore. - - org.openrewrite.text.FindAndReplace: - find: javax.validation. - replace: jakarta.validation. ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestarts -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/src/main/codestarts/**/*.java" -recipeList: - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.config. - replace: jakarta.json.bind.config. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.soap. - replace: jakarta.xml.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.security.jacc. - replace: jakarta.security.jacc. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.internet. - replace: jakarta.mail.internet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk. - replace: jakarta.batch.api.chunk. - - org.openrewrite.text.FindAndReplace: - find: javax.json.spi. - replace: jakarta.json.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource. - replace: jakarta.resource. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.work. - replace: jakarta.resource.spi.work. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation.adapters. - replace: jakarta.xml.bind.annotation.adapters. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.webapp. - replace: jakarta.faces.webapp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.application. - replace: jakarta.faces.application. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.util. - replace: jakarta.xml.bind.util. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.criteria. - replace: jakarta.persistence.criteria. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.event. - replace: jakarta.faces.event. - - org.openrewrite.text.FindAndReplace: - find: javax.activation. - replace: jakarta.activation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow.builder. - replace: jakarta.faces.flow.builder. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket. - replace: jakarta.websocket. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.serializer. - replace: jakarta.json.bind.serializer. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.se. - replace: jakarta.enterprise.inject.se. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.cci. - replace: jakarta.resource.cci. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.spi. - replace: jakarta.validation.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.transaction. - replace: jakarta.transaction. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.attachment. - replace: jakarta.xml.bind.attachment. - - org.openrewrite.text.FindAndReplace: - find: javax.interceptor. - replace: jakarta.interceptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.helpers. - replace: jakarta.xml.bind.helpers. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.embeddable. - replace: jakarta.ejb.embeddable. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence. - replace: jakarta.persistence. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject. - replace: jakarta.enterprise.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.event. - replace: jakarta.mail.event. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.endpoint. - replace: jakarta.resource.spi.endpoint. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.visit. - replace: jakarta.faces.component.visit. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl. - replace: jakarta.servlet.jsp.jstl. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.el. - replace: jakarta.servlet.jsp.el. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.el. - replace: jakarta.faces.el. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind. - replace: jakarta.xml.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.adapter. - replace: jakarta.json.bind.adapter. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.valueextraction. - replace: jakarta.validation.valueextraction. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view.facelets. - replace: jakarta.faces.view.facelets. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow. - replace: jakarta.faces.flow. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.render. - replace: jakarta.faces.render. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.util. - replace: jakarta.mail.util. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime.context. - replace: jakarta.batch.runtime.context. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.security. - replace: jakarta.annotation.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component. - replace: jakarta.faces.component. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.fmt. - replace: jakarta.servlet.jsp.jstl.fmt. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.spi. - replace: jakarta.json.bind.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet. - replace: jakarta.servlet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.operations. - replace: jakarta.batch.operations. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.push. - replace: jakarta.faces.push. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.descriptor. - replace: jakarta.servlet.descriptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler.soap. - replace: jakarta.xml.ws.handler.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.executable. - replace: jakarta.validation.executable. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.behavior. - replace: jakarta.faces.component.behavior. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation. - replace: jakarta.xml.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime. - replace: jakarta.batch.runtime. - - org.openrewrite.text.FindAndReplace: - find: javax.json.stream. - replace: jakarta.json.stream. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.annotation. - replace: jakarta.servlet.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.resources. - replace: jakarta.servlet.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.http. - replace: jakarta.servlet.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi.http. - replace: jakarta.xml.ws.spi.http. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.container. - replace: jakarta.ws.rs.container. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws. - replace: jakarta.xml.ws. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.spi. - replace: jakarta.enterprise.context.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi. - replace: jakarta.resource.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.validator. - replace: jakarta.faces.validator. - - org.openrewrite.text.FindAndReplace: - find: javax.jws. - replace: jakarta.jws. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation. - replace: jakarta.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.search. - replace: jakarta.faces.component.search. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind. - replace: jakarta.json.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.tlv. - replace: jakarta.servlet.jsp.jstl.tlv. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.core. - replace: jakarta.servlet.jsp.jstl.core. - - org.openrewrite.text.FindAndReplace: - find: javax.decorator. - replace: jakarta.decorator. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.bean. - replace: jakarta.faces.bean. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.sse. - replace: jakarta.ws.rs.sse. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.metamodel. - replace: jakarta.persistence.metamodel. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context. - replace: jakarta.enterprise.context. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi. - replace: jakarta.xml.ws.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api. - replace: jakarta.batch.api. - - org.openrewrite.text.FindAndReplace: - find: javax.el. - replace: jakarta.el. - - org.openrewrite.text.FindAndReplace: - find: javax.json. - replace: jakarta.json. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk.listener. - replace: jakarta.batch.api.chunk.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.spi. - replace: jakarta.persistence.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler. - replace: jakarta.xml.ws.handler. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.sql. - replace: jakarta.servlet.jsp.jstl.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.literal. - replace: jakarta.enterprise.inject.literal. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.ext. - replace: jakarta.ws.rs.ext. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraints. - replace: jakarta.validation.constraints. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.resources. - replace: jakarta.servlet.jsp.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraintvalidation. - replace: jakarta.validation.constraintvalidation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.lifecycle. - replace: jakarta.faces.lifecycle. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.callback. - replace: jakarta.security.auth.message.callback. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs. - replace: jakarta.ws.rs. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.config. - replace: jakarta.security.auth.message.config. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket.server. - replace: jakarta.websocket.server. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.authentication.mechanism.http. - replace: jakarta.security.enterprise.authentication.mechanism.http. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.event. - replace: jakarta.enterprise.event. - - org.openrewrite.text.FindAndReplace: - find: javax.inject. - replace: jakarta.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.listener. - replace: jakarta.batch.api.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.http. - replace: jakarta.xml.ws.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.soap. - replace: jakarta.xml.ws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi. - replace: jakarta.enterprise.inject.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces. - replace: jakarta.faces. - - org.openrewrite.text.FindAndReplace: - find: javax.jms. - replace: jakarta.jms. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.wsaddressing. - replace: jakarta.xml.ws.wsaddressing. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.bootstrap. - replace: jakarta.validation.bootstrap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.spi. - replace: jakarta.ejb.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.metadata. - replace: jakarta.validation.metadata. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp. - replace: jakarta.servlet.jsp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.convert. - replace: jakarta.faces.convert. - - org.openrewrite.text.FindAndReplace: - find: javax.mail. - replace: jakarta.mail. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.concurrent. - replace: jakarta.enterprise.concurrent. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.partition. - replace: jakarta.batch.api.partition. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.html. - replace: jakarta.faces.component.html. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi.configurator. - replace: jakarta.enterprise.inject.spi.configurator. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.credential. - replace: jakarta.security.enterprise.credential. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.control. - replace: jakarta.enterprise.context.control. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.annotation. - replace: jakarta.json.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.search. - replace: jakarta.mail.search. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.util. - replace: jakarta.enterprise.util. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.client. - replace: jakarta.ws.rs.client. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.model. - replace: jakarta.faces.model. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.security. - replace: jakarta.resource.spi.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view. - replace: jakarta.faces.view. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise. - replace: jakarta.security.enterprise. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.tagext. - replace: jakarta.servlet.jsp.tagext. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.core. - replace: jakarta.ws.rs.core. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.module. - replace: jakarta.security.auth.message.module. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.context. - replace: jakarta.faces.context. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message. - replace: jakarta.security.auth.message. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.sql. - replace: jakarta.annotation.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.annotation. - replace: jakarta.faces.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.groups. - replace: jakarta.validation.groups. - - org.openrewrite.text.FindAndReplace: - find: javax.jws.soap. - replace: jakarta.jws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb. - replace: jakarta.ejb. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.identitystore. - replace: jakarta.security.enterprise.identitystore. - - org.openrewrite.text.FindAndReplace: - find: javax.validation. - replace: jakarta.validation. ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestartsTests -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/src/test/resources/__snapshots__/**/*.java" -recipeList: - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.config. - replace: jakarta.json.bind.config. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.soap. - replace: jakarta.xml.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.security.jacc. - replace: jakarta.security.jacc. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.internet. - replace: jakarta.mail.internet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk. - replace: jakarta.batch.api.chunk. - - org.openrewrite.text.FindAndReplace: - find: javax.json.spi. - replace: jakarta.json.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource. - replace: jakarta.resource. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.work. - replace: jakarta.resource.spi.work. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation.adapters. - replace: jakarta.xml.bind.annotation.adapters. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.webapp. - replace: jakarta.faces.webapp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.application. - replace: jakarta.faces.application. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.util. - replace: jakarta.xml.bind.util. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.criteria. - replace: jakarta.persistence.criteria. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.event. - replace: jakarta.faces.event. - - org.openrewrite.text.FindAndReplace: - find: javax.activation. - replace: jakarta.activation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow.builder. - replace: jakarta.faces.flow.builder. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket. - replace: jakarta.websocket. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.serializer. - replace: jakarta.json.bind.serializer. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.se. - replace: jakarta.enterprise.inject.se. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.cci. - replace: jakarta.resource.cci. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.spi. - replace: jakarta.validation.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.transaction. - replace: jakarta.transaction. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.attachment. - replace: jakarta.xml.bind.attachment. - - org.openrewrite.text.FindAndReplace: - find: javax.interceptor. - replace: jakarta.interceptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.helpers. - replace: jakarta.xml.bind.helpers. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.embeddable. - replace: jakarta.ejb.embeddable. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence. - replace: jakarta.persistence. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject. - replace: jakarta.enterprise.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.event. - replace: jakarta.mail.event. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.endpoint. - replace: jakarta.resource.spi.endpoint. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.visit. - replace: jakarta.faces.component.visit. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl. - replace: jakarta.servlet.jsp.jstl. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.el. - replace: jakarta.servlet.jsp.el. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.el. - replace: jakarta.faces.el. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind. - replace: jakarta.xml.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.adapter. - replace: jakarta.json.bind.adapter. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.valueextraction. - replace: jakarta.validation.valueextraction. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view.facelets. - replace: jakarta.faces.view.facelets. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow. - replace: jakarta.faces.flow. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.render. - replace: jakarta.faces.render. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.util. - replace: jakarta.mail.util. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime.context. - replace: jakarta.batch.runtime.context. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.security. - replace: jakarta.annotation.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component. - replace: jakarta.faces.component. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.fmt. - replace: jakarta.servlet.jsp.jstl.fmt. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.spi. - replace: jakarta.json.bind.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet. - replace: jakarta.servlet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.operations. - replace: jakarta.batch.operations. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.push. - replace: jakarta.faces.push. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.descriptor. - replace: jakarta.servlet.descriptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler.soap. - replace: jakarta.xml.ws.handler.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.executable. - replace: jakarta.validation.executable. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.behavior. - replace: jakarta.faces.component.behavior. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation. - replace: jakarta.xml.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime. - replace: jakarta.batch.runtime. - - org.openrewrite.text.FindAndReplace: - find: javax.json.stream. - replace: jakarta.json.stream. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.annotation. - replace: jakarta.servlet.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.resources. - replace: jakarta.servlet.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.http. - replace: jakarta.servlet.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi.http. - replace: jakarta.xml.ws.spi.http. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.container. - replace: jakarta.ws.rs.container. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws. - replace: jakarta.xml.ws. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.spi. - replace: jakarta.enterprise.context.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi. - replace: jakarta.resource.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.validator. - replace: jakarta.faces.validator. - - org.openrewrite.text.FindAndReplace: - find: javax.jws. - replace: jakarta.jws. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation. - replace: jakarta.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.search. - replace: jakarta.faces.component.search. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind. - replace: jakarta.json.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.tlv. - replace: jakarta.servlet.jsp.jstl.tlv. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.core. - replace: jakarta.servlet.jsp.jstl.core. - - org.openrewrite.text.FindAndReplace: - find: javax.decorator. - replace: jakarta.decorator. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.bean. - replace: jakarta.faces.bean. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.sse. - replace: jakarta.ws.rs.sse. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.metamodel. - replace: jakarta.persistence.metamodel. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context. - replace: jakarta.enterprise.context. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi. - replace: jakarta.xml.ws.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api. - replace: jakarta.batch.api. - - org.openrewrite.text.FindAndReplace: - find: javax.el. - replace: jakarta.el. - - org.openrewrite.text.FindAndReplace: - find: javax.json. - replace: jakarta.json. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk.listener. - replace: jakarta.batch.api.chunk.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.spi. - replace: jakarta.persistence.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler. - replace: jakarta.xml.ws.handler. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.sql. - replace: jakarta.servlet.jsp.jstl.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.literal. - replace: jakarta.enterprise.inject.literal. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.ext. - replace: jakarta.ws.rs.ext. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraints. - replace: jakarta.validation.constraints. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.resources. - replace: jakarta.servlet.jsp.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraintvalidation. - replace: jakarta.validation.constraintvalidation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.lifecycle. - replace: jakarta.faces.lifecycle. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.callback. - replace: jakarta.security.auth.message.callback. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs. - replace: jakarta.ws.rs. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.config. - replace: jakarta.security.auth.message.config. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket.server. - replace: jakarta.websocket.server. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.authentication.mechanism.http. - replace: jakarta.security.enterprise.authentication.mechanism.http. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.event. - replace: jakarta.enterprise.event. - - org.openrewrite.text.FindAndReplace: - find: javax.inject. - replace: jakarta.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.listener. - replace: jakarta.batch.api.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.http. - replace: jakarta.xml.ws.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.soap. - replace: jakarta.xml.ws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi. - replace: jakarta.enterprise.inject.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces. - replace: jakarta.faces. - - org.openrewrite.text.FindAndReplace: - find: javax.jms. - replace: jakarta.jms. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.wsaddressing. - replace: jakarta.xml.ws.wsaddressing. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.bootstrap. - replace: jakarta.validation.bootstrap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.spi. - replace: jakarta.ejb.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.metadata. - replace: jakarta.validation.metadata. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp. - replace: jakarta.servlet.jsp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.convert. - replace: jakarta.faces.convert. - - org.openrewrite.text.FindAndReplace: - find: javax.mail. - replace: jakarta.mail. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.concurrent. - replace: jakarta.enterprise.concurrent. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.partition. - replace: jakarta.batch.api.partition. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.html. - replace: jakarta.faces.component.html. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi.configurator. - replace: jakarta.enterprise.inject.spi.configurator. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.credential. - replace: jakarta.security.enterprise.credential. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.control. - replace: jakarta.enterprise.context.control. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.annotation. - replace: jakarta.json.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.search. - replace: jakarta.mail.search. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.util. - replace: jakarta.enterprise.util. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.client. - replace: jakarta.ws.rs.client. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.model. - replace: jakarta.faces.model. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.security. - replace: jakarta.resource.spi.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view. - replace: jakarta.faces.view. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise. - replace: jakarta.security.enterprise. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.tagext. - replace: jakarta.servlet.jsp.tagext. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.core. - replace: jakarta.ws.rs.core. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.module. - replace: jakarta.security.auth.message.module. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.context. - replace: jakarta.faces.context. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message. - replace: jakarta.security.auth.message. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.sql. - replace: jakarta.annotation.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.annotation. - replace: jakarta.faces.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.groups. - replace: jakarta.validation.groups. - - org.openrewrite.text.FindAndReplace: - find: javax.jws.soap. - replace: jakarta.jws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb. - replace: jakarta.ejb. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.identitystore. - replace: jakarta.security.enterprise.identitystore. - - org.openrewrite.text.FindAndReplace: - find: javax.validation. - replace: jakarta.validation. ---- -type: specs.openrewrite.org/v1beta/recipe -name: io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlin -applicability: - singleSource: - - org.openrewrite.FindSourceFiles: - filePattern: "**/*.kt" -recipeList: - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.config. - replace: jakarta.json.bind.config. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.soap. - replace: jakarta.xml.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.security.jacc. - replace: jakarta.security.jacc. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.internet. - replace: jakarta.mail.internet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk. - replace: jakarta.batch.api.chunk. - - org.openrewrite.text.FindAndReplace: - find: javax.json.spi. - replace: jakarta.json.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource. - replace: jakarta.resource. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.work. - replace: jakarta.resource.spi.work. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation.adapters. - replace: jakarta.xml.bind.annotation.adapters. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.webapp. - replace: jakarta.faces.webapp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.application. - replace: jakarta.faces.application. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.util. - replace: jakarta.xml.bind.util. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.criteria. - replace: jakarta.persistence.criteria. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.event. - replace: jakarta.faces.event. - - org.openrewrite.text.FindAndReplace: - find: javax.activation. - replace: jakarta.activation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow.builder. - replace: jakarta.faces.flow.builder. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket. - replace: jakarta.websocket. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.serializer. - replace: jakarta.json.bind.serializer. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.se. - replace: jakarta.enterprise.inject.se. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.cci. - replace: jakarta.resource.cci. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.spi. - replace: jakarta.validation.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.transaction. - replace: jakarta.transaction. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.attachment. - replace: jakarta.xml.bind.attachment. - - org.openrewrite.text.FindAndReplace: - find: javax.interceptor. - replace: jakarta.interceptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.helpers. - replace: jakarta.xml.bind.helpers. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.embeddable. - replace: jakarta.ejb.embeddable. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence. - replace: jakarta.persistence. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject. - replace: jakarta.enterprise.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.event. - replace: jakarta.mail.event. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.endpoint. - replace: jakarta.resource.spi.endpoint. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.visit. - replace: jakarta.faces.component.visit. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl. - replace: jakarta.servlet.jsp.jstl. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.el. - replace: jakarta.servlet.jsp.el. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.el. - replace: jakarta.faces.el. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind. - replace: jakarta.xml.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.adapter. - replace: jakarta.json.bind.adapter. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.valueextraction. - replace: jakarta.validation.valueextraction. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view.facelets. - replace: jakarta.faces.view.facelets. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.flow. - replace: jakarta.faces.flow. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.render. - replace: jakarta.faces.render. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.util. - replace: jakarta.mail.util. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime.context. - replace: jakarta.batch.runtime.context. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.security. - replace: jakarta.annotation.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component. - replace: jakarta.faces.component. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.fmt. - replace: jakarta.servlet.jsp.jstl.fmt. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.spi. - replace: jakarta.json.bind.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet. - replace: jakarta.servlet. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.operations. - replace: jakarta.batch.operations. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.push. - replace: jakarta.faces.push. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.descriptor. - replace: jakarta.servlet.descriptor. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler.soap. - replace: jakarta.xml.ws.handler.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.executable. - replace: jakarta.validation.executable. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.behavior. - replace: jakarta.faces.component.behavior. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.bind.annotation. - replace: jakarta.xml.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.runtime. - replace: jakarta.batch.runtime. - - org.openrewrite.text.FindAndReplace: - find: javax.json.stream. - replace: jakarta.json.stream. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.annotation. - replace: jakarta.servlet.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.resources. - replace: jakarta.servlet.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.http. - replace: jakarta.servlet.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi.http. - replace: jakarta.xml.ws.spi.http. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.container. - replace: jakarta.ws.rs.container. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws. - replace: jakarta.xml.ws. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.spi. - replace: jakarta.enterprise.context.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi. - replace: jakarta.resource.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.validator. - replace: jakarta.faces.validator. - - org.openrewrite.text.FindAndReplace: - find: javax.jws. - replace: jakarta.jws. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation. - replace: jakarta.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.search. - replace: jakarta.faces.component.search. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind. - replace: jakarta.json.bind. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.tlv. - replace: jakarta.servlet.jsp.jstl.tlv. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.core. - replace: jakarta.servlet.jsp.jstl.core. - - org.openrewrite.text.FindAndReplace: - find: javax.decorator. - replace: jakarta.decorator. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.bean. - replace: jakarta.faces.bean. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.sse. - replace: jakarta.ws.rs.sse. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.metamodel. - replace: jakarta.persistence.metamodel. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context. - replace: jakarta.enterprise.context. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.spi. - replace: jakarta.xml.ws.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api. - replace: jakarta.batch.api. - - org.openrewrite.text.FindAndReplace: - find: javax.el. - replace: jakarta.el. - - org.openrewrite.text.FindAndReplace: - find: javax.json. - replace: jakarta.json. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.chunk.listener. - replace: jakarta.batch.api.chunk.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.persistence.spi. - replace: jakarta.persistence.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.handler. - replace: jakarta.xml.ws.handler. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.jstl.sql. - replace: jakarta.servlet.jsp.jstl.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.literal. - replace: jakarta.enterprise.inject.literal. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.ext. - replace: jakarta.ws.rs.ext. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraints. - replace: jakarta.validation.constraints. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.resources. - replace: jakarta.servlet.jsp.resources. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.constraintvalidation. - replace: jakarta.validation.constraintvalidation. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.lifecycle. - replace: jakarta.faces.lifecycle. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.callback. - replace: jakarta.security.auth.message.callback. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs. - replace: jakarta.ws.rs. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.config. - replace: jakarta.security.auth.message.config. - - org.openrewrite.text.FindAndReplace: - find: javax.websocket.server. - replace: jakarta.websocket.server. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.authentication.mechanism.http. - replace: jakarta.security.enterprise.authentication.mechanism.http. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.event. - replace: jakarta.enterprise.event. - - org.openrewrite.text.FindAndReplace: - find: javax.inject. - replace: jakarta.inject. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.listener. - replace: jakarta.batch.api.listener. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.http. - replace: jakarta.xml.ws.http. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.soap. - replace: jakarta.xml.ws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi. - replace: jakarta.enterprise.inject.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.faces. - replace: jakarta.faces. - - org.openrewrite.text.FindAndReplace: - find: javax.jms. - replace: jakarta.jms. - - org.openrewrite.text.FindAndReplace: - find: javax.xml.ws.wsaddressing. - replace: jakarta.xml.ws.wsaddressing. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.bootstrap. - replace: jakarta.validation.bootstrap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb.spi. - replace: jakarta.ejb.spi. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.metadata. - replace: jakarta.validation.metadata. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp. - replace: jakarta.servlet.jsp. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.convert. - replace: jakarta.faces.convert. - - org.openrewrite.text.FindAndReplace: - find: javax.mail. - replace: jakarta.mail. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.concurrent. - replace: jakarta.enterprise.concurrent. - - org.openrewrite.text.FindAndReplace: - find: javax.batch.api.partition. - replace: jakarta.batch.api.partition. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.component.html. - replace: jakarta.faces.component.html. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.inject.spi.configurator. - replace: jakarta.enterprise.inject.spi.configurator. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.credential. - replace: jakarta.security.enterprise.credential. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.context.control. - replace: jakarta.enterprise.context.control. - - org.openrewrite.text.FindAndReplace: - find: javax.json.bind.annotation. - replace: jakarta.json.bind.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.mail.search. - replace: jakarta.mail.search. - - org.openrewrite.text.FindAndReplace: - find: javax.enterprise.util. - replace: jakarta.enterprise.util. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.client. - replace: jakarta.ws.rs.client. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.model. - replace: jakarta.faces.model. - - org.openrewrite.text.FindAndReplace: - find: javax.resource.spi.security. - replace: jakarta.resource.spi.security. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.view. - replace: jakarta.faces.view. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise. - replace: jakarta.security.enterprise. - - org.openrewrite.text.FindAndReplace: - find: javax.servlet.jsp.tagext. - replace: jakarta.servlet.jsp.tagext. - - org.openrewrite.text.FindAndReplace: - find: javax.ws.rs.core. - replace: jakarta.ws.rs.core. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message.module. - replace: jakarta.security.auth.message.module. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.context. - replace: jakarta.faces.context. - - org.openrewrite.text.FindAndReplace: - find: javax.security.auth.message. - replace: jakarta.security.auth.message. - - org.openrewrite.text.FindAndReplace: - find: javax.annotation.sql. - replace: jakarta.annotation.sql. - - org.openrewrite.text.FindAndReplace: - find: javax.faces.annotation. - replace: jakarta.faces.annotation. - - org.openrewrite.text.FindAndReplace: - find: javax.validation.groups. - replace: jakarta.validation.groups. - - org.openrewrite.text.FindAndReplace: - find: javax.jws.soap. - replace: jakarta.jws.soap. - - org.openrewrite.text.FindAndReplace: - find: javax.ejb. - replace: jakarta.ejb. - - org.openrewrite.text.FindAndReplace: - find: javax.security.enterprise.identitystore. - replace: jakarta.security.enterprise.identitystore. - - org.openrewrite.text.FindAndReplace: - find: javax.validation. - replace: jakarta.validation. diff --git a/optaplanner-migration/src/test/java/org/optaplanner/migration/jakarta/JakartaJsonMigrationRecipeTest.java b/optaplanner-migration/src/test/java/org/optaplanner/migration/jakarta/JakartaJsonMigrationRecipeTest.java deleted file mode 100644 index 5e1d4031102..00000000000 --- a/optaplanner-migration/src/test/java/org/optaplanner/migration/jakarta/JakartaJsonMigrationRecipeTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.jakarta; - -import static org.openrewrite.java.Assertions.mavenProject; -import static org.openrewrite.maven.Assertions.pomXml; - -import org.junit.jupiter.api.Test; -import org.openrewrite.test.RewriteTest; - -class JakartaJsonMigrationRecipeTest implements RewriteTest { - - @Test - void migrateOptaPlannerPersistenceJsonB() { - rewriteRun( - spec -> spec.recipe(new JakartaJsonMigrationRecipe()) - .expectedCyclesThatMakeChanges(1), - mavenProject("optaplanner-persistence-jsonb", - pomXml( - "\n" - + - " 4.0.0\n" + - " org.optaplanner\n" + - " optaplanner-persistence-jsonb\n" + - " 0.0.1-SNAPSHOT\n" + - " \n" + - " \n" + - " org.glassfish\n" + - " jakarta.json\n" + - " runtime\n" + - " 1.1.6\n" + - " \n" + - " \n" + - " org.eclipse\n" + - " yasson\n" + - " test\n" + - " 1.0.11\n" + - " \n" + - " \n" + - " jakarta.json\n" + - " jakarta.json-api\n" + - " \n" + - " \n" + - " org.glassfish\n" + - " jakarta.json\n" + - " \n" + - " \n" + - " \n" + - " \n" + - "\n", - "\n" - + - " 4.0.0\n" + - " org.optaplanner\n" + - " optaplanner-persistence-jsonb\n" + - " 0.0.1-SNAPSHOT\n" + - " \n" + - " \n" + - " org.eclipse\n" + - " yasson\n" + - " test\n" + - " 1.0.11\n" + - " \n" + - " \n" + - "\n" - - ))); - } - - @Test - void migrateToJakartaJson() { - rewriteRun( - spec -> spec.recipe(new JakartaJsonMigrationRecipe()) - .expectedCyclesThatMakeChanges(1), - mavenProject("any-project", - pomXml( - "\n" - + - " 4.0.0\n" + - " org.optaplanner\n" + - " optaplanner-examples\n" + - " 0.0.1-SNAPSHOT\n" + - " \n" + - " \n" + - " org.glassfish\n" + - " jakarta.json\n" + - " 1.1.6\n" + - " \n" + - " \n" + - "\n", - "\n" - + - " 4.0.0\n" + - " org.optaplanner\n" + - " optaplanner-examples\n" + - " 0.0.1-SNAPSHOT\n" + - " \n" + - " \n" + - " jakarta.json\n" + - " jakarta.json-api\n" + - " 1.1.6\n" + - " \n" + - " \n" + - "\n" - - ))); - } -} diff --git a/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/AsConstraintRecipeTest.java b/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/AsConstraintRecipeTest.java deleted file mode 100644 index 149f5d5c846..00000000000 --- a/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/AsConstraintRecipeTest.java +++ /dev/null @@ -1,2157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.v8; - -import static org.openrewrite.java.Assertions.java; - -import org.junit.jupiter.api.Test; -import org.openrewrite.test.RecipeSpec; -import org.openrewrite.test.RewriteTest; - -class AsConstraintRecipeTest implements RewriteTest { - - @Override - public void defaults(RecipeSpec spec) { - spec.recipe(new AsConstraintRecipe()) - .parser(AsConstraintRecipe.buildJavaParser()); - } - - // ************************************************************************ - // Uni - // ************************************************************************ - - @Test - void uniPenalizeName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniPenalizeNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD, (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable(\"My constraint\", (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable((a) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\", (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurable((a) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniPenalizeNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableLong(\"My constraint\", (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableLong((a) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableLong(\"My package\", \"My constraint\", (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableLong((a) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniPenalizeNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My constraint\", (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableBigDecimal((a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniPenalizeConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My package\", \"My constraint\", (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .penalizeConfigurableBigDecimal((a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD, (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable(\"My constraint\", (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable((a) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\", (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurable((a) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableLong(\"My constraint\", (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableLong((a) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableLong(\"My package\", \"My constraint\", (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableLong((a) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniRewardConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My constraint\", (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableBigDecimal((a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniRewardConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My package\", \"My constraint\", (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .rewardConfigurableBigDecimal((a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniImpactName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniImpactId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniImpactNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD, (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniImpactIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniImpactNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impactLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniImpactIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impactLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void uniImpactNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impactBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void uniImpactIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .impactBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - // ************************************************************************ - // Bi - // ************************************************************************ - - @Test - void biPenalizeName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biPenalizeNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD, (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a, b) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a, b) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My constraint\", (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable((a, b) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\", (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable((a, b) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biPenalizeNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a, b) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a, b) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong(\"My constraint\", (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong((a, b) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong(\"My package\", \"My constraint\", (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong((a, b) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biPenalizeNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My constraint\", (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal((a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biPenalizeConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My package\", \"My constraint\", (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal((a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD, (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a, b) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a, b) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My constraint\", (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable((a, b) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\", (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable((a, b) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a, b) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a, b) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong(\"My constraint\", (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong((a, b) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong(\"My package\", \"My constraint\", (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong((a, b) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biRewardConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My constraint\", (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal((a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biRewardConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My package\", \"My constraint\", (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal((a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biImpactName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biImpactId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biImpactNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD, (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a, b) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biImpactIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a, b) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biImpactNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a, b) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biImpactIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a, b) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void biImpactNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void biImpactIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - // ************************************************************************ - // Tri - // ************************************************************************ - - @Test - void triPenalizeName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triPenalizeNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD, (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a, b, c) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a, b, c) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My constraint\", (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable((a, b, c) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\", (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable((a, b, c) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triPenalizeNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong(\"My constraint\", (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong((a, b, c) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong(\"My package\", \"My constraint\", (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong((a, b, c) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triPenalizeNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My constraint\", (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal((a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triPenalizeConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My package\", \"My constraint\", (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal((a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD, (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a, b, c) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a, b, c) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My constraint\", (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable((a, b, c) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\", (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable((a, b, c) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong(\"My constraint\", (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong((a, b, c) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong(\"My package\", \"My constraint\", (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong((a, b, c) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triRewardConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My constraint\", (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal((a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triRewardConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My package\", \"My constraint\", (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal((a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triImpactName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triImpactId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triImpactNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD, (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a, b, c) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triImpactIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b, c) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a, b, c) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triImpactNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triImpactIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a, b, c) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void triImpactNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void triImpactIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - // ************************************************************************ - // Quad - // ************************************************************************ - - @Test - void quadPenalizeName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadPenalizeNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My constraint\", HardSoftScore.ONE_HARD, (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a, b, c, d) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalize(HardSoftScore.ONE_HARD, (a, b, c, d) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My constraint\", (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable((a, b, c, d) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable(\"My package\", \"My constraint\", (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurable((a, b, c, d) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadPenalizeNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeLong(HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong(\"My constraint\", (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong((a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong(\"My package\", \"My constraint\", (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableLong((a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadPenalizeNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN)\n" - + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN)\n" - + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My constraint\", (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal((a, b, c, d) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadPenalizeConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal(\"My package\", \"My constraint\", (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .penalizeConfigurableBigDecimal((a, b, c, d) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardConfigurableName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardConfigurableId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\");"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable()\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My constraint\", HardSoftScore.ONE_HARD, (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a, b, c, d) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .reward(HardSoftScore.ONE_HARD, (a, b, c, d) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardConfigurableNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My constraint\", (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable((a, b, c, d) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardConfigurableIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable(\"My package\", \"My constraint\", (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurable((a, b, c, d) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardLong(HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardConfigurableNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong(\"My constraint\", (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong((a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardConfigurableIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong(\"My package\", \"My constraint\", (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableLong((a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN)\n" - + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN)\n" - + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadRewardConfigurableNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My constraint\", (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal((a, b, c, d) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadRewardConfigurableIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal(\"My package\", \"My constraint\", (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .rewardConfigurableBigDecimal((a, b, c, d) -> BigDecimal.TEN)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadImpactName() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadImpactId() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadImpactNameMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My constraint\", HardSoftScore.ONE_HARD, (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a, b, c, d) -> 7)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadImpactIdMatchWeigherInt() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(\"My package\", \"My constraint\", HardSoftScore.ONE_HARD, (a, b, c, d) -> 7);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impact(HardSoftScore.ONE_HARD, (a, b, c, d) -> 7)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadImpactNameMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(\"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadImpactIdMatchWeigherLong() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(\"My package\", \"My constraint\", HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactLong(HardSoftLongScore.ONE_HARD, (a, b, c, d) -> 7L)\n" + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - @Test - void quadImpactNameMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(\"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN)\n" - + - " .asConstraint(\"My constraint\");"))); - } - - @Test - void quadImpactIdMatchWeigherBigDecimal() { - rewriteRun(java( - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(\"My package\", \"My constraint\", HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN);"), - wrap(" return f.forEach(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .join(String.class)\n" + - " .impactBigDecimal(HardSoftBigDecimalScore.ONE_HARD, (a, b, c, d) -> BigDecimal.TEN)\n" - + - " .asConstraint(\"My package\", \"My constraint\");"))); - } - - // ************************************************************************ - // Helper methods - // ************************************************************************ - - private static String wrap(String content) { - return "import java.math.BigDecimal;\n" + - "import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;\n" + - "import org.optaplanner.core.api.score.buildin.hardsoftlong.HardSoftLongScore;\n" + - "import org.optaplanner.core.api.score.buildin.hardsoftbigdecimal.HardSoftBigDecimalScore;\n" + - "import org.optaplanner.core.api.score.stream.ConstraintFactory;\n" + - "import org.optaplanner.core.api.score.stream.Constraint;\n" + - "\n" + - "class Test {\n" + - " Constraint myConstraint(ConstraintFactory f) {\n" + - content + "\n" + - " }" + - "}\n"; - } - -} diff --git a/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/ScoreGettersRecipeTest.java b/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/ScoreGettersRecipeTest.java deleted file mode 100644 index 011ac5c1664..00000000000 --- a/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/ScoreGettersRecipeTest.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.v8; - -import static org.openrewrite.java.Assertions.java; - -import org.junit.jupiter.api.Test; -import org.openrewrite.test.RecipeSpec; -import org.openrewrite.test.RewriteTest; - -class ScoreGettersRecipeTest implements RewriteTest { - - @Override - public void defaults(RecipeSpec spec) { - spec.recipe(new ScoreGettersRecipe()) - .parser(ScoreGettersRecipe.buildJavaParser()); - } - - @Test - void bendableScore() { - runTest("org.optaplanner.core.api.score.buildin.bendable.BendableScore", - "BendableScore score = BendableScore.of(new int[] {1, 2}, new int[] {3, 4});", - "int scoreLevelsSize = score.getLevelsSize();\n" + - "int hardScoreLevelsSize = score.getHardLevelsSize();\n" + - "int[] hardScores = score.getHardScores();\n" + - "int hardScore0 = score.getHardScore(0);\n" + - "int softScoreLevelsSize = score.getSoftLevelsSize();\n" + - "int[] softScores = score.getSoftScores();\n" + - "int softScore1 = score.getSoftScore(1);\n" + - "int initScore = score.getInitScore();\n", - "int scoreLevelsSize = score.levelsSize();\n" + - "int hardScoreLevelsSize = score.hardLevelsSize();\n" + - "int[] hardScores = score.hardScores();\n" + - "int hardScore0 = score.hardScore(0);\n" + - "int softScoreLevelsSize = score.softLevelsSize();\n" + - "int[] softScores = score.softScores();\n" + - "int softScore1 = score.softScore(1);\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void bendableBigDecimalScore() { - runTest("org.optaplanner.core.api.score.buildin.bendablebigdecimal.BendableBigDecimalScore", - "BendableBigDecimalScore score = BendableBigDecimalScore.of(\n" + - " new BigDecimal[] {BigDecimal.ONE},\n" + - " new BigDecimal[] {BigDecimal.ONE, BigDecimal.TEN});", - "int scoreLevelsSize = score.getLevelsSize();\n" + - "int hardScoreLevelsSize = score.getHardLevelsSize();\n" + - "BigDecimal[] hardScores = score.getHardScores();\n" + - "BigDecimal hardScore0 = score.getHardScore(0);\n" + - "int softScoreLevelsSize = score.getSoftLevelsSize();\n" + - "BigDecimal[] softScores = score.getSoftScores();\n" + - "BigDecimal softScore1 = score.getSoftScore(1);\n" + - "int initScore = score.getInitScore();\n", - "int scoreLevelsSize = score.levelsSize();\n" + - "int hardScoreLevelsSize = score.hardLevelsSize();\n" + - "BigDecimal[] hardScores = score.hardScores();\n" + - "BigDecimal hardScore0 = score.hardScore(0);\n" + - "int softScoreLevelsSize = score.softLevelsSize();\n" + - "BigDecimal[] softScores = score.softScores();\n" + - "BigDecimal softScore1 = score.softScore(1);\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void bendableLongScore() { - runTest("org.optaplanner.core.api.score.buildin.bendablelong.BendableLongScore", - "BendableLongScore score = BendableLongScore.of(" + - " new long[] {1L}, " + - " new long[] {1L, 10L});", - "int scoreLevelsSize = score.getLevelsSize();\n" + - "int hardScoreLevelsSize = score.getHardLevelsSize();\n" + - "long[] hardScores = score.getHardScores();\n" + - "long hardScore0 = score.getHardScore(0);\n" + - "int softScoreLevelsSize = score.getSoftLevelsSize();\n" + - "long[] softScores = score.getSoftScores();\n" + - "long softScore1 = score.getSoftScore(1);\n" + - "int initScore = score.getInitScore();\n", - "int scoreLevelsSize = score.levelsSize();\n" + - "int hardScoreLevelsSize = score.hardLevelsSize();\n" + - "long[] hardScores = score.hardScores();\n" + - "long hardScore0 = score.hardScore(0);\n" + - "int softScoreLevelsSize = score.softLevelsSize();\n" + - "long[] softScores = score.softScores();\n" + - "long softScore1 = score.softScore(1);\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void hardMediumSoftScore() { - runTest("org.optaplanner.core.api.score.buildin.hardmediumsoft.HardMediumSoftScore", - "HardMediumSoftScore score = HardMediumSoftScore.of(1, 2, 3);", - "int hardScore = score.getHardScore();\n" + - "int mediumScore = score.getMediumScore();\n" + - "int softScore = score.getSoftScore();\n" + - "int initScore = score.getInitScore();\n", - "int hardScore = score.hardScore();\n" + - "int mediumScore = score.mediumScore();\n" + - "int softScore = score.softScore();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void hardMediumSoftBigDecimalScore() { - runTest("org.optaplanner.core.api.score.buildin.hardmediumsoftbigdecimal.HardMediumSoftBigDecimalScore", - "HardMediumSoftBigDecimalScore score = HardMediumSoftBigDecimalScore.of(BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TEN);", - "BigDecimal hardScore = score.getHardScore();\n" + - "BigDecimal mediumScore = score.getMediumScore();\n" + - "BigDecimal softScore = score.getSoftScore();\n" + - "int initScore = score.getInitScore();\n", - "BigDecimal hardScore = score.hardScore();\n" + - "BigDecimal mediumScore = score.mediumScore();\n" + - "BigDecimal softScore = score.softScore();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void hardMediumSoftLongScore() { - runTest("org.optaplanner.core.api.score.buildin.hardmediumsoftlong.HardMediumSoftLongScore", - "HardMediumSoftLongScore score = HardMediumSoftLongScore.of(1L, 2L, 3L);", - "long hardScore = score.getHardScore();\n" + - "long mediumScore = score.getMediumScore();\n" + - "long softScore = score.getSoftScore();\n" + - "int initScore = score.getInitScore();\n", - "long hardScore = score.hardScore();\n" + - "long mediumScore = score.mediumScore();\n" + - "long softScore = score.softScore();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void hardSoftScore() { - runTest("org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore", - "HardSoftScore score = HardSoftScore.of(1, 2);", - "int hardScore = score.getHardScore();\n" + - "int softScore = score.getSoftScore();\n" + - "int initScore = score.getInitScore();\n", - "int hardScore = score.hardScore();\n" + - "int softScore = score.softScore();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void hardSoftBigDecimalScore() { - runTest("org.optaplanner.core.api.score.buildin.hardsoftbigdecimal.HardSoftBigDecimalScore", - "HardSoftBigDecimalScore score = HardSoftBigDecimalScore.of(BigDecimal.ZERO, BigDecimal.ONE);", - "BigDecimal hardScore = score.getHardScore();\n" + - "BigDecimal softScore = score.getSoftScore();\n" + - "int initScore = score.getInitScore();\n", - "BigDecimal hardScore = score.hardScore();\n" + - "BigDecimal softScore = score.softScore();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void hardSoftLongScore() { - runTest("org.optaplanner.core.api.score.buildin.hardsoftlong.HardSoftLongScore", - "HardSoftLongScore score = HardSoftLongScore.of(1L, 2L);", - "long hardScore = score.getHardScore();\n" + - "long softScore = score.getSoftScore();\n" + - "int initScore = score.getInitScore();\n", - "long hardScore = score.hardScore();\n" + - "long softScore = score.softScore();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void simpleScore() { - runTest("org.optaplanner.core.api.score.buildin.simple.SimpleScore", - "SimpleScore score = SimpleScore.of(1);", - "int value = score.getScore();\n" + - "int initScore = score.getInitScore();\n", - "int value = score.score();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void simpleBigDecimalScore() { - runTest("org.optaplanner.core.api.score.buildin.simplebigdecimal.SimpleBigDecimalScore", - "SimpleBigDecimalScore score = SimpleBigDecimalScore.of(BigDecimal.ONE);", - "BigDecimal value = score.getScore();\n" + - "int initScore = score.getInitScore();\n", - "BigDecimal value = score.score();\n" + - "int initScore = score.initScore();\n"); - } - - @Test - void simpleLongScore() { - runTest("org.optaplanner.core.api.score.buildin.simplelong.SimpleLongScore", - "SimpleLongScore score = SimpleLongScore.of(1L);", - "long value = score.getScore();\n" + - "int initScore = score.getInitScore();\n", - "long value = score.score();\n" + - "int initScore = score.initScore();\n"); - } - - private void runTest(String scoreImplClassFqn, String scoreDeclaration, String before, String after) { - rewriteRun(java(wrap(scoreImplClassFqn, scoreDeclaration, before), wrap(scoreImplClassFqn, scoreDeclaration, after))); - } - - private static String wrap(String scoreImplClassFqn, String scoreDeclaration, String content) { - return "import java.math.BigDecimal;\n" + - "import " + scoreImplClassFqn + ";\n" + - "\n" + - "class Test {\n" + - " public static void main(String[] args) {\n" + - scoreDeclaration.trim() + "\n" + - content.trim() + "\n" + - " }" + - "}\n"; - } - -} diff --git a/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/ScoreManagerMethodsRecipeTest.java b/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/ScoreManagerMethodsRecipeTest.java deleted file mode 100644 index 75f842e351d..00000000000 --- a/optaplanner-migration/src/test/java/org/optaplanner/migration/v8/ScoreManagerMethodsRecipeTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.optaplanner.migration.v8; - -import static org.openrewrite.java.Assertions.java; - -import org.junit.jupiter.api.Test; -import org.openrewrite.test.RecipeSpec; -import org.openrewrite.test.RewriteTest; - -class ScoreManagerMethodsRecipeTest implements RewriteTest { - - @Override - public void defaults(RecipeSpec spec) { - spec.recipe(new ScoreManagerMethodsRecipe()) - .parser(ScoreManagerMethodsRecipe.buildJavaParser()); - } - - @Test - void summary() { - runTest("String summary = scoreManager.getSummary(solution);", - "String summary = scoreManager.explain(solution, SolutionUpdatePolicy.UPDATE_SCORE_ONLY).getSummary();"); - } - - @Test - void explain() { - runTest("ScoreExplanation explanation = scoreManager.explainScore(solution);", - "ScoreExplanation explanation = scoreManager.explain(solution, SolutionUpdatePolicy.UPDATE_SCORE_ONLY);"); - } - - @Test - void update() { - runTest("Object score = scoreManager.updateScore(solution);", - "Object score = scoreManager.update(solution, SolutionUpdatePolicy.UPDATE_SCORE_ONLY);"); - } - - private void runTest(String before, String after) { - rewriteRun(java( - wrap(before, false), - wrap(after, true))); - } - - private static String wrap(String content, boolean addImport) { - return "import org.optaplanner.core.api.score.ScoreManager;\n" + - (addImport ? "import org.optaplanner.core.api.solver.SolutionUpdatePolicy;\n" : "") + - "import org.optaplanner.core.api.score.ScoreExplanation;\n" + - "import org.optaplanner.core.api.solver.SolverFactory;\n" + - "\n" + - "class Test {\n" + - " public static void main(String[] args) {\n" + - " SolverFactory solverFactory = SolverFactory.create(null);\n" + - " ScoreManager scoreManager = ScoreManager.create(solverFactory);\n" + - " Object solution = null;\n" + - " " + content.trim() + "\n" + - " }" + - "}\n"; - } - -} diff --git a/pom.xml b/pom.xml index 3e36bcf40d2..1fd7d393ede 100644 --- a/pom.xml +++ b/pom.xml @@ -150,7 +150,6 @@ optaplanner-test optaplanner-spring-integration optaplanner-quarkus-integration - optaplanner-migration optaplanner-examples @@ -179,29 +178,5 @@ optaplanner-operator - - - 8-to-9-migration - - - migration - - - - - - - org.openrewrite.maven - rewrite-maven-plugin - ${version.rewrite.plugin} - - - - -