Test Management for Jira Cloud

JUnit

Annotating JUnit tests in a TM4J development project enables results to be sent from JUnit directly to Jira. All it takes is a pre-made script within a task.

This topic illustrates the workflow, explains how to configure the TM4J library for JUnit tests, and walks you through how to properly annotate JUnit tests.

Workflow: TM4J and JUnit

Here’s how the components work together:

100%
100%

Configure the TM4J Library to Receive JUnit Test Results

  1. Download the TM4J/Junit integration repository from our Bitbucket.

  2. Add the automation library to your project by following the instructions in the README section.
    This enables you to annotate your JUnit tests with a TM4J key or name and generate a custom report when you run tests.
    To send the test results to Jira, you’ll need to include a pre-made script (see the task below).

Annotating JUnit Tests

  1. Add the dependency to your pom file for the Test Management for Jira JUnit library.

    100%

  2. Register the TM4J JUnit listener.

    100%

    This will generate the results file with test case keys.

  3. Add annotations to your JUnit tests for the test case key or name.

    100%

  4. Run the tests with this command: mvn test
    The TM4J test-execution-result file generates in the same execution folder.

Finally, if you want to see an example of the TM4J integration with JUnit in action, we’ve got you covered.