paparazzi
paparazzi copied to clipboard
JUnit 4 and Jupiter integration
As promised in #282. See the individual commits.
Let me know what you think of it so far, and happy to help with other things, if necessary, but also feel free to commit and finish this branch/PR.
Few things of note left to do (anyone can chip in!):
- [ ] Introduce a Paparazzi Interface which can be implemented by the JUnit rule and delegates to instance
(unless you're ok withpaparazzi.instance.snapshot
) - [ ] Add the logic of AgentTestRule to PaparazziExtension (not sure if it can be composed the same way, might need to inline it there as one extension.
- [ ] Add
registerInterceptors
to PaparazziExtension (I didn't do this because it wasn't clear what was your intended lifecycle of this. I'm not sure if it's defined when the body ofTestRule.apply
is executed. I don't think that can be relied on as a "lifecycle" event. Anyway, I'm sure there's a fitting lifecycle interface inorg.junit.jupiter.api.extension
package. - [ ] Consider renaming junit5 to jupiter, 5 is not the most fitting, see https://junit.org/junit5/docs/current/user-guide/#overview-what-is-junit-5.
- [ ] Mention in Paparazzi docs and on extension class that any kind of parallel execution of jupiter is not supported by Paparazzi because <reason>.
- [ ] Fix all the compilation errors and tests, and provide migration path / docs for users.
- [ ] Review TestName implementation, I'm not sure that's the right thing to do in Paparazzi, it looks like doesn't take into account JUnit
@Parameterized
tests, JUnitParams@Parameters(...)
or JUnit Jupiter@ParameterizedTest
.