Complete the code to apply the Java plugin in Gradle.
plugins {
id '[1]'
}The java plugin is required to enable Java compilation and testing tasks in Gradle.
Complete the code to configure the test task to use JUnit Platform.
test {
use[1]()
}The useJUnitPlatform() method configures Gradle to run tests using JUnit 5.
Fix the error in the test dependencies block to include JUnit Jupiter API.
dependencies {
testImplementation '[1]'
}The correct dependency for JUnit 5 API is org.junit.jupiter:junit-jupiter-api with a recent version.
Fill both blanks to configure test logging to show passed and failed tests.
test {
testLogging {
events [1]
exceptionFormat [2]
}
}The events property takes a list of test events to log, and exceptionFormat controls how exceptions are shown. 'full' shows detailed stack traces.
Fill all three blanks to create a custom test task named 'integrationTest' that runs after 'test'.
task integrationTest(type: Test) {
description = '[1]'
group = '[2]'
mustRunAfter [3]
}The description explains the task purpose. The group 'verification' groups test tasks. The mustRunAfter ensures this task runs after the 'test' task.