Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions src/main/resources/META-INF/rewrite/jakarta-ee-9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,9 @@ recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.fasterxml.jackson.datatype.jsr353.JSR353Module
newFullyQualifiedTypeName: com.fasterxml.jackson.datatype.jsonp.JSONPModule
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule
newFullyQualifiedTypeName: com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule

---
type: specs.openrewrite.org/v1beta/recipe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,40 @@ private JSONPModule getModule() {
)
);
}

@Test
void thatJaxbAnnotationModuleIsRewritten() {
rewriteRun(
spec -> spec.parser(JavaParser.fromJavaVersion().classpath(
"jackson-core",
"jackson-databind",
"jackson-module-jaxb-annotations",
"jackson-module-jakarta-xmlbind-annotations")),
//language=java
java(
"""
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;

public class JacksonTest {
void foo() {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JaxbAnnotationModule());
}
}
""",
"""
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule;

public class JacksonTest {
void foo() {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JakartaXmlBindAnnotationModule());
}
}
"""
)
);
}
}
Loading