You can manually modify your build system to ensure that the required are available. The following sections list all the libraries UTA may require. The set of dependencies you need to configure depends on your testing framework and may vary between projects.
Adding Dependencies in Maven
Modify the pom.xml file by updating the <dependencies>
section.
Multi-module projects may require centralizing dependency information in the <dependencyManagement>
section.
If you use JUnit 5 or both JUnit 5 and 4:
<!-- JUnit 5 --> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.6.2</version> <scope>test</scope> </dependency> <!-- JUnit 5 runner for JUnit 4--> <dependency> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> <version>5.6.2</version> <scope>test</scope> </dependency> <!-- Mockito --> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>3.3.3</version> <scope>test</scope> </dependency> <!-- Add if you create Spring integration tests --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>5.2.5.RELEASE</version> <scope>test</scope> </dependency>
If you only use JUnit 4:
<!-- JUnit 4 --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13</version> <scope>test</scope> </dependency> <!-- JUnitParams for JUnit 4 --> <dependency> <groupId>pl.pragmatists</groupId> <artifactId>JUnitParams</artifactId> <version>1.1.1</version> <scope>test</scope> </dependency> <!-- PowerMock for JUnit 4 --> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <version>2.0.7</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito2</artifactId> <version>2.0.7</version> <scope>test</scope> </dependency> <!-- Mockito --> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>3.3.3</version> <scope>test</scope> </dependency> <!-- Add if you create Spring integration tests --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>5.2.5.RELEASE</version> <scope>test</scope> </dependency>
Adding Dependencies in Gradle
Modify the build.gradle file by updating the following sections. The following entries include all the required libraries:
If you use JUnit 5 or both JUnit 5 and 4:
test { useJUnitPlatform() } dependencies { // JUnit 5 testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2' testImplementation 'org.junit.jupiter:junit-jupiter-params:5.6.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2' // JUnit 5 runner for JUnit 4 testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.6.2' // Mockito testImplementation 'org.mockito:mockito-core:3.3.3' //Add if you create Spring integration tests testImplementation 'org.springframework:spring-test:5.2.5.RELEASE' }
If you only use JUnit 4:
dependencies { // JUnit 4 testImplementation 'junit:junit:4.13' // JUnitParams for JUnit4 testImplementation 'pl.pragmatists:JUnitParams:1.1.1' // Powermock for JUnit 4 testImplementation 'org.powermock:powermock-module-junit4:2.0.7' testImplementation 'org.powermock:powermock-api-mockito2:2.0.7' // Mockito testImplementation 'org.mockito:mockito-core:3.3.3' //Add if you create Spring integration tests testImplementation 'org.springframework:spring-test:5.2.5.RELEASE' }
Adding Dependencies in Ant
Ant requires all required JAR files to be added to a separate directory. You must manually include the directory in the build.xml file:
<classpath> <!-- filesets can be used in classpath and bootpath --> <fileset dir="C:/directory_name/lib"> <include name="**/*.jar"/> </fileset> </classpath>
The following libraries are required:
- apiguardian-api-1.1.0.jar
- byte-buddy-1.10.9.jar
- byte-buddy-agent-1.10.9.jar
- hamcrest-2.2.jar
- javassist-3.27.0-GA.jar
- junit-4.13.jar
- junit-jupiter-api-5.6.2.jar
- junit-jupiter-engine-5.6.2.jar
- junit-jupiter-migrationsupport-5.6.2.jar
- junit-jupiter-params-5.6.2.jar
- JUnitParams-1.1.1.jar
- junit-platform-commons-1.6.2.jar
- junit-platform-engine-1.6.2.jar
- junit-platform-launcher-1.6.2.jar
- junit-platform-runner-1.6.2.jar
- junit-platform-suite-api-1.6.2.jar
- junit-vintage-engine-5.6.2.jar
- mockito-core-3.3.3.jar
- mockito-junit-jupiter-3.3.3.jar
- objenesis-3.1.jar
- opentest4j-1.2.0.jar
- powermock-api-mockito2-2.0.7.jar
- powermock-api-support-2.0.7.jar
- powermock-core-2.0.7.jar
- powermock-module-junit4-2.0.7.jar
- powermock-module-junit4-common-2.0.7.jar
- powermock-reflect-2.0.7.jar
The libraries are available online or in the [INSTALL_DIR]/examples/demo/lib
.