spring-cloud-commons icon indicating copy to clipboard operation
spring-cloud-commons copied to clipboard

Switch remaining jUnit 4 tests to jUnit jupiter

Open OlgaMaciaszek opened this issue 4 years ago • 10 comments

OlgaMaciaszek avatar Jun 28 '21 09:06 OlgaMaciaszek

Assigning to @robertmcnees

spencergibb avatar Jul 02 '21 13:07 spencergibb

Hello @spencergibb, Can I take this up if nobody is working on it already? Thanks in advance!

deepakchethan avatar Jul 04 '21 14:07 deepakchethan

Someone is assigned already

spencergibb avatar Jul 04 '21 16:07 spencergibb

Moved back to open so more modules can be converted.

robertmcnees avatar Jul 08 '21 13:07 robertmcnees

@ManasviGoyal is working on reducing method and class visibility after the conversion to JUnitJupiter.

OlgaMaciaszek avatar Jul 21 '21 14:07 OlgaMaciaszek

Gave it a quick try to convert more classes over to JUnit 5; outcome here: https://github.com/spring-cloud/spring-cloud-commons/compare/main...timtebeek:increase-junit-platform-usage This is mostly the result of applying the JUnit4 to 5 conversion from OpenRewrite.

I had not yet created a merge request (although willing) as it appeared @ManasviGoyal was also working on this previously, and I don't know the current state of that effort.

I had dropped the Adhoc suites for now, as they are ignored currently, and converting them to disabled suites would require additional depencies. Please let me know if these should be restored as they were or converted with the added dependencies.

There's quite a few tests left over that rely on the ModifiedClassPathRunner; is anyone aware of a similar mechanism for JUnit Jupiter? I'm aware of the FilteredClassLoader when testing Auto-configuration, but I don't know it that would be applicable here.

timtebeek avatar Oct 03 '21 21:10 timtebeek

@timtebeek, @spencergibb is currently working on an alternative to the ModifiedClassPathRunner for JUpiter. We'll update here once that's done.

OlgaMaciaszek avatar Oct 21 '21 14:10 OlgaMaciaszek

Any replacement for the ModifiedClassPathRunner could also help complete the Jupiter migration in https://github.com/spring-cloud/spring-cloud-gateway/pull/2387, so mentioning that here to have a feedback loop back to that issue as well.

timtebeek avatar Nov 23 '21 10:11 timtebeek

Noticed there's a ModifiedClassPathExtension in Spring Boot; would that be suitable here as well?

timtebeek avatar Jan 27 '22 19:01 timtebeek

yes, I have local branch with a copy, but there are errors I haven't had time to work thru.

spencergibb avatar Jan 27 '22 23:01 spencergibb