Repository navigation
Conversation
|
|
||
| @RunWith(SpringJUnit4ClassRunner.class) | ||
| @ExtendWith(SpringExtension.class) | ||
| @ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/jobs/amqp-example-job.xml", "/job-runner-context.xml" }) |
There was a problem hiding this comment.
Not really important, but if @ContextConfiguration is replaced with @SpringJUnitConfig, the @ExtendWith(SpringExtension.class) can be omitted, which makes the code a bit leaner.
@SpringJUnitConfig is basically @ContextConfiguration but meta-annotated with @ExtendWith(SpringExtension.class).
There was a problem hiding this comment.
+1 to using @SpringJUnitConfig here and in every test class changed in this PR. Another PR could be opened to update all tests cases to use this annotation where appropriate.
There was a problem hiding this comment.
The tests have been migrated to JUnit 5 and @SpringJUnitConfig in #4173. When the PR is rebased, the tests in the sample module shouldn't require much change.
|
I like how we removed the dependency to any testing library in e90330b! π I'm not sure what would be the best exception to throw when the file comparison fails, but if you think In hindsight, everything in that |
Since I had to add the dependency to the tests to have them pass because of the change made in the previous commit, I decided to migrate all tests to JUnit 5. 2 things to note: * I used Spring's AssertionErrors on some AssertTrue or AssertFalse methods so that we could maintain the message. * In a couple of cases the use of assertNotSame that was used had a message, but is no longer supported, so I removed those messages.
The side effect is a breaking change in that it will now throw IllegalStateException instead of the Compare and AssertExceptions provided by JUnit.
9dda1cb to
ccdfba6
Compare
Revert the removal of `@SpringJUnitConfig` usage in the test suite of samples. Related to #4111
resolves #4111