Skip to content
Closed
Show file tree
Hide file tree
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 @@ -389,6 +389,11 @@ recipeList:
# module: spring-boot-security
newPackageName: org.springframework.boot.security.autoconfigure.actuate.web.servlet
recursive: true
# spring-boot-actuator → spring-boot-webmvc
- org.openrewrite.java.ChangePackage:
oldPackageName: org.springframework.boot.actuate.endpoint.web.servlet
newPackageName: org.springframework.boot.webmvc.actuate.endpoint.web
recursive: true
# spring-boot-actuator → spring-boot-health
# Types that move to health.actuate.endpoint (must be listed before the catch-all ChangePackage)
- org.openrewrite.java.ChangeType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,42 @@ public Health health() {

}

@Nested
class MigrateActuateEndpointWebServletPackage implements RewriteTest {
@Override
public void defaults(RecipeSpec spec) {
spec.recipeFromResource(
"/META-INF/rewrite/spring-boot-40-modular-starters.yml",
"org.openrewrite.java.spring.boot4.MigrateToModularStarters"
).parser(JavaParser.fromJavaVersion()
.classpathFromResources(new InMemoryExecutionContext(),
"spring-boot-actuator-3"));
}

@Test
void migrateWebMvcEndpointHandlerMapping() {
rewriteRun(
//language=java
java(
"""
import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping;

class MyConfig {
WebMvcEndpointHandlerMapping handlerMapping;
}
""",
"""
import org.springframework.boot.webmvc.actuate.endpoint.web.WebMvcEndpointHandlerMapping;

class MyConfig {
WebMvcEndpointHandlerMapping handlerMapping;
}
"""
)
);
}
}

@Nested
class MigrateAutoconfigurePackages {
@Test
Expand Down
Loading