Skip to content

Update the test to use JUnit 5 #81

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

Closed
plamentotev opened this issue Apr 7, 2018 · 4 comments
Closed

Update the test to use JUnit 5 #81

plamentotev opened this issue Apr 7, 2018 · 4 comments

Comments

@plamentotev
Copy link
Member

plamentotev commented Apr 7, 2018

Now that Java 8 is required we can use JUnit 5. It brings some nice features such as Assume that allows a test to be skipped based on run-time conditions. There are some tests that are not run on Windows but currently they are reported as passed, with Assume they will be properly reported as skipped.

@jorsol
Copy link
Contributor

jorsol commented Jul 15, 2022

This should now be changed to JUnit 5 😉

@plamentotev plamentotev changed the title Update the test to use JUnit 4 Update the test to use JUnit 5 Jul 15, 2022
@plamentotev
Copy link
Member Author

I've updated the description. @jorsol do you work on that or you just noticed the ticket. I ask because I've just started playing around with migrating to JUnit5.

@jorsol
Copy link
Contributor

jorsol commented Jul 16, 2022

I've updated the description. @jorsol do you work on that or you just noticed the ticket. I ask because I've just started playing around with migrating to JUnit5.

I just noticed the ticket, I wish to work on this but I don't have enough time to tackle this.

plamentotev added a commit that referenced this issue Jul 18, 2022
* Migrate org.junit.* to org.junit.jupiter.api.*
* Fix the assertions. In JUnit 5 the message is
  the last argument, not the first. Move all messages
  to the end of the arguments list.
* Replace JUnit4 rules with JUnit 5 build-in extensions.
* Remove dependency to hamcrest as it is used only in
  single test. Use the JUnit5 assertions instead.
* Sisu's InjectedTest setup and tearDown methods are
  not annotated with the JUnit5 annotations - @beforeeach
  and @AfterEach. Override those methods in TestSupport
  and place the respective annotations so those methods
  are invoked before/after each test.
* @beforeeach and @AfterEach are not inherited when
  the method is overridden. Place the appropriate
  annotation where there are such methods, so they
  are executed before/after each test.

Closes #81
@plamentotev
Copy link
Member Author

I've migrated the test and they work with JUnit 5. I think I'll do some obvious improvements that are supported in JUnit 5 and then merge it master. Any suggestion/comments are greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants