Test Management for Jira Server

JUnit

If you use JUnit for your testing, complete the following two steps.

First, add the dependency to get access to the JUnit listener and the annotations to your pom.xml file.

<dependencies>
    <dependency>
        <groupId>com.adaptavist</groupId>
        <artifactId>Adaptavist Test Management for Jira-junit-integration</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>

This dependency is not currently deployed on Maven Central Repository, so please note the custom repository added to the pom.xml file:

<repositories>
    <repository>
        <id>adaptavist-repository</id>
        <name>Adaptavist Repository</name>
        <url>https://nexus.adaptavist.com/content/repositories/external-snapshots</url>
    </repository>
</repositories>

Next, register the Test Management for Jira JUnit Listener. This listener generates the correct JSON output file needed for uploading to Test Management for Jira.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.0</version>
                <configuration>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>com.adaptavist.Adaptavist Test Management for Jira.junit.ExecutionListener</value>
                        </property>
                    </properties>
                </configuration>
        </plugin>
    </plugins>
</build>

This enables you to annotate your JUnit tests with a Test Management for Jira key or name, which then generates a custom report when you run the tests.

To send these results to Jira, include a pre-made script (see the following section).

Alternatively, if you use our Jenkins plugin, you can create a task to do this for you. A task and a script is also required if using other CI tools.

Want to know more about annotating JUnit tests and testing locally? We got you.