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

chore(scheduler): Replace deprectated Mockito annotations #3456

Merged

Conversation

silvestre
Copy link
Member

@silvestre silvestre commented Jan 17, 2025

Issue

Warning:  /__w/app-autoscaler-release/app-autoscaler-release/src/scheduler/src/test/java/org/cloudfoundry/autoscaler/scheduler/service/ScheduleManagerTest.java:[94,4] org.springframework.boot.test.mock.mockito.SpyBean in org.springframework.boot.test.mock.mockito has been deprecated and marked for removal

Fix

Run Replace @MockBean and @SpyBean
OpenRewrite recipe:

$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.exportDatatables=true -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.ReplaceMockBeanAndSpyBean
...
Estimate time saved: 30m

# Issue

```
Warning:  /__w/app-autoscaler-release/app-autoscaler-release/src/scheduler/src/test/java/org/cloudfoundry/autoscaler/scheduler/service/ScheduleManagerTest.java:[94,4] org.springframework.boot.test.mock.mockito.SpyBean in org.springframework.boot.test.mock.mockito has been deprecated and marked for removal

```

# Fix

Run [Replace `@MockBean` and `@SpyBean`
](https://docs.openrewrite.org/recipes/java/boot3/replacemockbeanandspybean) OpenRewrite recipe:

```
$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.exportDatatables=true -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.ReplaceMockBeanAndSpyBean
```
@silvestre silvestre enabled auto-merge (rebase) January 17, 2025 16:38
@silvestre silvestre merged commit 3c673c7 into main Jan 17, 2025
34 of 38 checks passed
@silvestre silvestre deleted the org.openrewrite.java.boot3.ReplaceMockBeanAndSpyBean branch January 17, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants