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

Migrate to JUnit 5 from JUnit 4 in related to spring module #5036

Merged
merged 9 commits into from Aug 4, 2023

Conversation

heowc
Copy link
Contributor

@heowc heowc commented Jul 15, 2023

Motivation:

Starting from spring boot 2.4.0, junit5 is recommended. That's why we need to respond in the same way.

Modifications:

  • org.junit.Test -> org.junit.jupiter.api.Test
  • Remove org.junit.runner.RunWith
  • Change some @AutoConfigureMetrics to @AutoConfigureObservability
  • TestRule globalTimeout -> @Timeout(10)

Result:

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also remove AutoConfigureMetrics in the actuator test classes? 😉
e.g. ArmeriaSpringActuatorAutoConfigurationSecureTest

@heowc
Copy link
Contributor Author

heowc commented Jul 20, 2023

Could you also remove AutoConfigureMetrics in the actuator test classes? 😉 e.g. ArmeriaSpringActuatorAutoConfigurationSecureTest

I tried to change it, but those annotations have changed since 3.0.0, so I didn't modify the code to work with 2.x.

@minwoox
Copy link
Member

minwoox commented Jul 21, 2023

I tried to change it, but those annotations have changed since 3.0.0, so I didn't modify the code to work with 2.x.

Ah, you changed it in the test of it/spring/boo3-taomcat10. I didn't notice it. Please forget about the comment. 😓

# Conflicts:
#	spring/boot3-autoconfigure/src/test/java/com/linecorp/armeria/spring/ArmeriaAutoConfigurationTest.java
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for cleaning this up, @heowc!

@ikhoon
Copy link
Contributor

ikhoon commented Jul 27, 2023

Q: Is there a reason that you didn't migrate the tests in the actuator modules?

@heowc
Copy link
Contributor Author

heowc commented Jul 27, 2023

Q: Is there a reason that you didn't migrate the tests in the actuator modules?

XXX-actuator module seems to already work with junit5 🤔

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup! Left a minor comment 👍

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (f94002a) 74.20% compared to head (1dbead7) 74.19%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5036      +/-   ##
============================================
- Coverage     74.20%   74.19%   -0.01%     
  Complexity    19464    19464              
============================================
  Files          1671     1671              
  Lines         71721    71721              
  Branches       9182     9182              
============================================
- Hits          53219    53216       -3     
- Misses        14180    14185       +5     
+ Partials       4322     4320       -2     

see 18 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup 👍 🙇 👍

@ikhoon
Copy link
Contributor

ikhoon commented Jul 31, 2023

Q: Is there a reason that you didn't migrate the tests in the actuator modules?

XXX-actuator module seems to already work with junit5 🤔

Right. I was confused.

@ikhoon ikhoon added the cleanup label Jul 31, 2023
@ikhoon ikhoon added this to the 1.25.0 milestone Jul 31, 2023
Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up, @heowc! ❤️

Copy link
Member

@trustin trustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, @heowc! 🙇

@trustin trustin merged commit 3d169b6 into line:main Aug 4, 2023
15 checks passed
@heowc heowc deleted the feature/4788 branch August 4, 2023 04:37
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.

Migrate JUnit 4 tests in Spring Boot integration modules to JUnit 5
5 participants