Skip to content

Commit f85728b

Browse files
committed
This testcase should start working after ChangeType and ChangePackage adapt the new SourceFileWithReference construction
1 parent dd7ec21 commit f85728b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import static org.openrewrite.java.Assertions.*;
2727
import static org.openrewrite.maven.Assertions.pomXml;
28+
import static org.openrewrite.xml.Assertions.xml;
2829

2930
class JavaxToJakartaTest implements RewriteTest {
3031

@@ -610,4 +611,36 @@ public class TestApplication {
610611
)
611612
);
612613
}
614+
615+
@Test
616+
void shouldRefactorSpringBeanXml() {
617+
//language=java
618+
rewriteRun(
619+
//language=XML
620+
xml(
621+
"""
622+
<?xml version="1.0" encoding="UTF-8"?>
623+
<beans xmlns="http://www.springframework.org/schema/beans"
624+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
625+
<bean id="exampleBean" class="org.springframework.beans.ExampleBean">
626+
<property name="conFactory">
627+
<value>javax.jms.ConnectionFactory</value>
628+
</property>
629+
</bean>
630+
</beans>
631+
""",
632+
"""
633+
<?xml version="1.0" encoding="UTF-8"?>
634+
<beans xmlns="http://www.springframework.org/schema/beans"
635+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
636+
<bean id="exampleBean" class="org.springframework.beans.ExampleBean">
637+
<property name="conFactory">
638+
<value>jakarta.jms.ConnectionFactory</value>
639+
</property>
640+
</bean>
641+
</beans>
642+
"""
643+
)
644+
);
645+
}
613646
}

0 commit comments

Comments
 (0)