paparazzi icon indicating copy to clipboard operation
paparazzi copied to clipboard

JUnit 4 and Jupiter integration

Open TWiStErRob opened this issue 3 years ago • 0 comments

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 with paparazzi.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 of TestRule.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 in org.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.

TWiStErRob avatar Nov 03 '21 23:11 TWiStErRob