NESOY / junit5-example

πŸ§ͺ Introducing JUnit5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JUnit5 Tutorial

Requirements

  • Java8
  • Platform
    • ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•΄μ£ΌλŠ” 런처 제곡. TestEngine API 제곡.
    • Maven / Gradle Plugins, JUnit4 Runner
  • Jupiter
    • JUnit 5λ₯Ό μ§€μ›ν•˜λŠ” TestEngine API κ΅¬ν˜„μ²΄
  • Vintage
    • JUnit 4와 3을 μ§€μ›ν•˜λŠ” TestEngine API κ΅¬ν˜„μ²΄

JUnit4 Migration Guide

JUnit 4 & JUnit 5 λ™μ‹œμ— ν•  수 μ—†μ„κΉŒ?

<dependencies>
        <!--  JUnit5  -->
        <dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>${junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
        <dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
        <!--  JUnit4  -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
        <dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<version>${junit.vintage.version}</version>
			<scope>test</scope>
		</dependency>
</dependencies>
dependencies {
    // JUnit 5
    testImplementation('org.junit.jupiter:junit-jupiter:5.5.2')
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2'

    // JUnit 4
    testImplementation("junit:junit:4.12")
    testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.2"
}

JUnit5 Testing in IDE

Reference

About

πŸ§ͺ Introducing JUnit5


Languages

Language:Java 100.0%