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.

(info) 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.9.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.9.2</version>
    <scope>test</scope>
</dependency>

<!-- Mockito-inline -->
<dependency>
	<groupId>org.mockito</groupId>
	<artifactId>mockito-inline</artifactId>
	<version>4.4.0</version>
	<scope>test</scope>
</dependency>  

<!-- Add if you create Spring integration tests -->
<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-test</artifactId>
	<version>5.3.18.RELEASE</version>
	<scope>test</scope>
</dependency>

If you only use JUnit 4:

<!-- JUnit 4 -->
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.13.2</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>

<!-- Mockito-inline -->
<dependency>
	<groupId>org.mockito</groupId>
	<artifactId>mockito-inline</artifactId>
	<version>4.4.0</version>
	<scope>test</scope>
</dependency> 

<!-- Add if you create Spring integration tests -->
<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-test</artifactId>
	<version>5.3.18.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.9.2'
    testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.9.2'

    // JUnit 5 runner for JUnit 4
    testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.2'

	// Mockito-inline 
	testImplementation 'org.mockito:mockito-inline:4.4.0'

	//Add if you create Spring integration tests
    testImplementation 'org.springframework:spring-test:5.3.18.RELEASE'
}


If you only use JUnit 4:

dependencies {
    // JUnit 4
    testImplementation 'junit:junit:4.13.2'

    // JUnitParams for JUnit4
    testImplementation 'pl.pragmatists:JUnitParams:1.1.1'

	// Mockito-inline
	testImplementation 'org.mockito:mockito-inline:4.4.0'
  
	//Add if you create Spring integration tests
    testImplementation 'org.springframework:spring-test:5.3.18.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.2.jar
  • byte-buddy-1.12.8.jar
  • byte-buddy-agent-1.12.8.jar
  • hamcrest-2.2.jar
  • junit-4.13.2.jar
  • junit-jupiter-api-5.9.2.jar
  • junit-jupiter-engine-5.9.2.jar
  • junit-jupiter-migrationsupport-5.9.2.jar
  • junit-jupiter-params-5.9.2.jar
  • JUnitParams-1.1.1.jar
  • junit-platform-commons-1.9.2.jar
  • junit-platform-engine-1.9.2.jar
  • junit-platform-launcher-1.9.2.jar
  • junit-platform-runner-1.9.2.jar
  • junit-platform-suite-api-1.9.2.jar
  • junit-vintage-engine-5.9.2.jar
  • mockito-inline-4.4.0.jar
  • mockito-junit-jupiter-4.4.0.jar
  • objenesis-3.2.jar
  • opentest4j-1.2.0.jar

The libraries are available online or in the <INSTALL_DIR>/examples/demo/lib.

  • No labels