Unlike previous versions of JUnit, JUnit 5 is composed of several different modules from three different sub-projects.
JUnit 5 requires Java 8 (or higher) at runtime. However, you can still test code that has been compiled with previous versions of the JDK
JUnit 5 replaces JUnit 4 annotations
@Before >> @BeforeEach@BeforeClass >> @BeforeAll@After >> @AfterEach@AfterClass >> @AfterAll@Ignore >> @DisabledJUnit 5 also introductes new annotations
@DisplayName@Nested@ParameterizedTestFor detailed information on these annotations, please see JUnit 5 Annotations
JUnit 5 introduces new assertions
assertThrowsassertTimeoutassertAllFor detailed information on these annotations, please see JUnit 5 Assertions
For detailed information on these annotations, please see JUnit 5 Extension Model
@RunWith(JUnitPlatform.class)For detailed information on these annotations, please see JUnit 5 Using JUnit 4 to run JUnit Platform
@Autowired, @Qualifier, @Value@ExtendWith(SpringExtension.class)@SpringJUnitConfig = @ExtendWith(SpringExtension.class) +
@ContextConfigurationFor detailed information on these annotations, please see Spring TestContext Framework Extension for JUnit 5