Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Unit Testing in Java How to Test Setting Up a Project for Tests

Manish Giri
Manish Giri
16,266 Points

Compatibility with JUnit 5?

JUnit 5 has been released, and it would be nice to learn this version instead of JUnit 4. So, I wanted to know if the JUnit topics covered in these lessons would work with JUnit 5 as well.


1 Answer

JUnit5 is backwards compatible. That means everything you do with JUnit4 you can also do with JUnit5. So feel free to use JUnit5, and when you're done with the course, explore some of its cool new features. Personally, I'm very excited about it. There are lots of new tools that will no doubt change the way we write tests! https://developer.ibm.com/dwblog/2017/best-new-features-junit-5/

Look here on how to run JUnit5 with backwards compatibility: http://junit.org/junit5/docs/current/user-guide/#migrating-from-junit4-running