Skip to content

Commit

Permalink
Polish JavaxTransactionMigrationToJakartaTransactionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Sep 13, 2024
1 parent 01888dd commit 544581f
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openrewrite.java.migrate.jakarta;
package org.openrewrite.java.migrate.jakarta;

import org.intellij.lang.annotations.Language;
import org.junit.jupiter.api.Test;

import org.openrewrite.DocumentExample;
import org.openrewrite.config.Environment;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

import static org.openrewrite.java.Assertions.*;
import static org.openrewrite.java.Assertions.java;

public class JavaxTransactionMigrationToJakartaTransactionTest implements RewriteTest {
class JavaxTransactionMigrationToJakartaTransactionTest implements RewriteTest {
@Language("java")
private static final String javax_transaction =
"""
Expand Down Expand Up @@ -67,12 +66,13 @@ void doNotChangeImportWhenPackageFromJavaSE() {
spec -> spec.parser(JavaParser.fromJavaVersion().dependsOn(javax_transaction_xa)),
//language=java
java(
"""
import javax.transaction.xa.*;
public class A {
XAResource xa;
}
""")
"""
import javax.transaction.xa.*;
public class A {
XAResource xa;
}
"""
)
);
}

Expand All @@ -83,7 +83,7 @@ void changeImportWhenPackageFromJakartaTransaction() {
spec -> spec.parser(JavaParser.fromJavaVersion().dependsOn(javax_transaction, jakarta_transaction)),
//language=java
java(
"""
"""
import javax.transaction.Transactional;
@Transactional
public class A {
Expand All @@ -96,7 +96,8 @@ public void foo() {}
public class A {
public void foo() {}
}
""")
"""
)
);
}
}

0 comments on commit 544581f

Please sign in to comment.