Skip to content
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>
"""
)
);
}
}