Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof that javax.jms is migrated to jakarta.jms in spring.xml #603

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import static org.openrewrite.java.Assertions.*;
import static org.openrewrite.maven.Assertions.pomXml;
import static org.openrewrite.xml.Assertions.xml;

class JavaxToJakartaTest implements RewriteTest {

Expand Down Expand Up @@ -610,4 +611,35 @@ public class TestApplication {
)
);
}

@Test
void shouldRefactorSpringBeanXml() {
rewriteRun(
//language=XML
xml(
"""
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="exampleBean" class="org.springframework.beans.ExampleBean">
<property name="conFactory">
<value>javax.jms.ConnectionFactory</value>
</property>
</bean>
</beans>
""",
"""
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="exampleBean" class="org.springframework.beans.ExampleBean">
<property name="conFactory">
<value>jakarta.jms.ConnectionFactory</value>
</property>
</bean>
</beans>
"""
)
);
}
}