Spring Boot 2.1でJUnit 5.5を使用する

testCompile 'org.springframework.boot:spring-boot-starter-test'

を以下の通り変更する。

testCompile('org.springframework.boot:spring-boot-starter-test') {
   exclude module: 'junit'
}

さらに、以下の行を追加する。

testImplementation 'org.junit.jupiter:junit-jupiter-api'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'

なお、Spring Boot 2.2からはJUnit 5.5が標準になったので、上記の対応は不要となる。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください