Skip to content

Commit

Permalink
Do not rewrite @QuarkusTestResource to @WithTestResource anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Aug 27, 2024
1 parent 15237de commit 9f3f850
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,93 +23,6 @@ public void defaults(RecipeSpec spec) {
.typeValidationOptions(TypeValidation.all());
}

@Test
void testWithTestResource() {
//language=java
rewriteRun(java(
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.QuarkusTestResource;
@QuarkusTestResource
public class GitHubAppTest {
}
""",
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.WithTestResource;
@WithTestResource(restrictToAnnotatedClass = false)
public class GitHubAppTest {
}
"""));

//language=java
rewriteRun(java(
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.QuarkusTestResource;
@QuarkusTestResource(restrictToAnnotatedClass = false)
public class GitHubAppTest {
}
""",
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.WithTestResource;
@WithTestResource(restrictToAnnotatedClass = false)
public class GitHubAppTest {
}
"""));

//language=java
rewriteRun(java(
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.QuarkusTestResource;
@QuarkusTestResource(restrictToAnnotatedClass = true)
class GitHubAppTest {
}
""",
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.WithTestResource;
@WithTestResource(restrictToAnnotatedClass = true)
class GitHubAppTest {
}
"""));

//language=java
rewriteRun(java(
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.QuarkusTestResource;
@QuarkusTestResource(parallel = true)
class GitHubAppTest {
}
""",
"""
package io.quarkiverse.githubapp.test;
import io.quarkus.test.common.WithTestResource;
@WithTestResource(restrictToAnnotatedClass = false, parallel = true)
class GitHubAppTest {
}
"""));
}

@Test
void testUpdateTestOIDCAuthServerUrl() {
@Language("properties")
Expand Down
20 changes: 0 additions & 20 deletions recipes/src/main/resources/quarkus-updates/core/3.13.alpha1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@ recipeList:
groupId: org.hibernate.orm
artifactId: hibernate-jpamodelgen
#####
# Replace @QuarkusTestResource with @WithTestResource while keeping the original behavior
#####
---
type: specs.openrewrite.org/v1beta/recipe
name: io.quarkus.updates.core.quarkus313.WithTestResource
recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: io.quarkus.test.common.QuarkusTestResource
newFullyQualifiedTypeName: io.quarkus.test.common.WithTestResource
---
# The default for WithTestResource is different so if using the default value, let's enforce it
type: specs.openrewrite.org/v1beta/recipe
name: io.quarkus.updates.core.quarkus313.WithTestResourceRestrictToAnnotatedClassValue
recipeList:
- org.openrewrite.java.AddOrUpdateAnnotationAttribute:
annotationType: io.quarkus.test.common.WithTestResource
attributeName: restrictToAnnotatedClass
attributeValue: false
addOnly: true
#####
# Adjust package properties in config files - native sources
#####
---
Expand Down

0 comments on commit 9f3f850

Please sign in to comment.