Unit Testing

android-junit5

de.mannodermaus.gradle.plugins : android-junit5

Unit Testing with JUnit 5 for Android.

Last Version: 1.8.2.0

Release Date:

gradle-plugin-randomizedtesting-junit4

org.xbib.elasticsearch : gradle-plugin-randomizedtesting-junit4

Gradle plugins for the developer kit for building and testing Elasticsearch and Elasticsearch plugins

Last Version: 6.3.2.5

Release Date:

junit-toolkit

uk.co.thebadgerset : junit-toolkit

JUnit Toolkit enhances JUnit with performance testing, asymptotic behaviour analysis, and concurrency testing.

Last Version: 0.7

Release Date:

Easy Coverage for JUnit

com.tocea.easycoverage : easyCoverage4J-junit

Framework for generating unit tests and provides a minimal coverage.

Last Version: 2.3.1

Release Date:

KoPeMe - JUnit 5

de.dagere.kopeme : kopeme-junit5

KoPeMe-JUnit 5 integration module

Last Version: 1.1.8

Release Date:

Last Version: 1.0.0-beta10

Release Date:

mongock-springboot-junit5

io.mongock : mongock-springboot-junit5

Test utils for Mongock springboot with Junit5

Last Version: 5.1.0

Release Date:

Last Version: 0.5.0

Release Date:

Last Version: 2.2.0

Release Date:

Last Version: 0.9.9

Release Date:

Last Version: 5.3.2

Release Date:

pact-jvm-provider-junit5

au.com.dius : pact-jvm-provider-junit5

# Pact Junit 5 Extension ## Overview For writing Pact verification tests with JUnit 5, there is an JUnit 5 Invocation Context Provider that you can use with the `@TestTemplate` annotation. This will generate a test for each interaction found for the pact files for the provider. To use it, add the `@Provider` and one of the pact source annotations to your test class (as per a JUnit 4 test), then add a method annotated with `@TestTemplate` and `@ExtendWith(PactVerificationInvocationContextProvider.class)` that takes a `PactVerificationContext` parameter. You will need to call `verifyInteraction()` on the context parameter in your test template method. For example: ```java @Provider("myAwesomeService") @PactFolder("pacts") public class ContractVerificationTest { @TestTemplate @ExtendWith(PactVerificationInvocationContextProvider.class) void pactVerificationTestTemplate(PactVerificationContext context) { context.verifyInteraction(); } } ``` For details on the provider and pact source annotations, refer to the [Pact junit runner](../pact-jvm-provider-junit/README.md) docs. ## Test target You can set the test target (the object that defines the target of the test, which should point to your provider) on the `PactVerificationContext`, but you need to do this in a before test method (annotated with `@BeforeEach`). There are three different test targets you can use: `HttpTestTarget`, `HttpsTestTarget` and `AmpqTestTarget`. For example: ```java @BeforeEach void before(PactVerificationContext context) { context.setTarget(HttpTestTarget.fromUrl(new URL(myProviderUrl))); // or something like // context.setTarget(new HttpTestTarget("localhost", myProviderPort, "/")); } ``` **Note for Maven users:** If you use Maven to run your tests, you will have to make sure that the Maven Surefire plugin is at least version 2.22.1 uses an isolated classpath. For example, configure it by adding the following to your POM: ```xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> <configuration> <useSystemClassLoader>false</useSystemClassLoader> </configuration> </plugin> ``` ## Provider State Methods Provider State Methods work in the same way as with JUnit 4 tests, refer to the [Pact junit runner](../pact-jvm-provider-junit/README.md) docs. ### Using multiple classes for the state change methods If you have a large number of state change methods, you can split things up by moving them to other classes. You will need to specify the additional classes on the test context in a `Before` method. Do this with the `withStateHandler` or `setStateHandlers` methods. See [StateAnnotationsOnAdditionalClassTest](src/test/java/au/com/dius/pact/provider/junit5/StateAnnotationsOnAdditionalClassTest.java) for an example. ## Modifying the requests before they are sent **Important Note:** You should only use this feature for things that can not be persisted in the pact file. By modifying the request, you are potentially modifying the contract from the consumer tests! Sometimes you may need to add things to the requests that can't be persisted in a pact file. Examples of these would be authentication tokens, which have a small life span. The Http and Https test targets support injecting the request that will executed into the test template method. You can then add things to the request before calling the `verifyInteraction()` method. For example to add a header: ```java @TestTemplate @ExtendWith(PactVerificationInvocationContextProvider.class) void testTemplate(PactVerificationContext context, HttpRequest request) { // This will add a header to the request request.addHeader("X-Auth-Token", "1234"); context.verifyInteraction(); } ``` ## Objects that can be injected into the test methods You can inject the following objects into your test methods (just like the `PactVerificationContext`). They will be null if injected before the supported phase. | Object | Can be injected from phase | Description | | ------ | --------------- | ----------- | | PactVerificationContext | @BeforeEach | The context to use to execute the interaction test | | Pact | any | The Pact model for the test | | Interaction | any | The Interaction model for the test | | HttpRequest | @TestTemplate | The request that is going to be executed (only for HTTP and HTTPS targets) | | ProviderVerifier | @TestTemplate | The verifier instance that is used to verify the interaction | ## Allowing the test to pass when no pacts are found to verify (version 4.0.7+) By default, the test will fail with an exception if no pacts were found to verify. This can be overridden by adding the `@IgnoreNoPactsToVerify` annotation to the test class. For this to work, you test class will need to be able to receive null values for any of the injected parameters.

Last Version: 4.0.10

Release Date:

ROX Client jUnit

com.lotaris.rox.client : rox-client-junit

JUnit ROX Center client. Client able to send test results to ROX Center from JUnit tests.

Last Version: 2.2.2

Release Date:

JUnit repeat rule

com.github.cbismuth : junit-repeat-rule

A simple JUnit repetition rule with built-in concurrency support.

Last Version: 1.1.2

Release Date:

com.automation.remarks.video-recorder

com.automation-remarks : video-recorder-junit5

Video Recorder is a library that allows to record selenium tests

Last Version: 2.0

Release Date:

Last Version: 1.3

Release Date:

Kotest

io.kotest : kotest-runner-junit5

Kotlin Test Framework

Last Version: 5.3.2

Release Date:

KoPeMe - JUnit

de.dagere.kopeme : kopeme-junit

KoPeMe-JUnit integration module

Last Version: 0.18.1

Release Date:

allure-junit4-aspect

io.qameta.allure : allure-junit4-aspect

Module allure-junit4-aspect of Allure Framework.

Last Version: 2.18.1

Release Date:

junit-platform-otel-api

com.ryandens : junit-platform-otel-api

Implementations of JUnit Platform extension points for tracing of JUnit test suites with Open Telemetry

Last Version: 0.1.0

Release Date:

org-netbeans-modules-junit-ant

org.netbeans.modules : org-netbeans-modules-junit-ant

Apache NetBeans is an integrated development environment, tooling platform, and application framework.

Last Version: RELEASE140

Release Date:

tourniquet-tx

io.tourniquet.junit : tourniquet-tx

Dealing with user transactions in tests.

Last Version: 0.4.8

Release Date:

android-junit3-dbunit

com.uphyca : android-junit3-dbunit

Tools for Android testing with JUnit4

Last Version: 0.5

Release Date:

concurrent-junit

com.vmlens : concurrent-junit

A http://junit.org test runner to run concurrent unit tests.

Last Version: 1.0.2

Release Date:

junit

org.robolectric : junit

An alternative Android testing framework.

Last Version: 4.8.1

Release Date:

Last Version: 2.0.0

Release Date:

Last Version: 1.0.0-beta10

Release Date:

JUnit Toolkit

com.thesett : junit-toolkit

JUnit Toolkit enhances JUnit with performance testing, asymptotic behaviour analysis, and concurrency testing.

Last Version: 0.9.52

Release Date:

Extended Mockito

com.github.aro-tech : extended-mockito

Jar with Mockito as a mixin interface, plus extra features

Last Version: 4.4.0.1

Release Date:

Last Version: 3.3.0.0-SNAP2

Release Date:

Stubr (stubr-mockito)

ch.leadrian.stubr : stubr-mockito

Library for instantiating stub objects in unit tests

Last Version: 2.1.0-b3

Release Date:

Last Version: 3.2.10.0

Release Date:

Dexmaker

com.linkedin.dexmaker : dexmaker-mockito-inline

Implementation of the Mockito Inline API for use on the Android Dalvik VM

Last Version: 2.28.1

Release Date:

Mockito

com.google.code.maven-play-plugin.com.google.code.eamelink-mockito : mockito-all

Mock objects library for java, modified to allow cache disabling

Last Version: 1.9.1-20110911

Release Date:

Mockito Collections - Core

uk.co.webamoeba.mockito.collections : mockito-collections-core

Mockito Collections allows injection of Mockito mocks into Collection fields

Last Version: 1.0.0-RC-01

Release Date:

HK2 Mockito

org.glassfish.hk2 : hk2-mockito

A utility for spying on HK2 services using Mockito

Last Version: 3.0.3

Release Date:

Last Version: 3.3.0.0-SNAP3

Release Date:

Last Version: 2.0.3-RELEASE

Release Date:

mockitoid

de.jodamob.android : mockitoid

Mockito mocks and asserts for android

Last Version: 0.7

Release Date:

mockspresso-mockito

com.episode6.hackit.mockspresso : mockspresso-mockito

An extensible auto-mocker for java, designed to simplify your unit tests.

Last Version: 0.1.0

Release Date:

jsmockito

org.webjars : jsmockito

WebJar for jsmockito

Last Version: 1.0.4

Release Date:

mockito-extensions

io.github.theangrydev.fluentbdd : mockito-extensions

A BDD framework to help write tests in a fluent way, reusing givens, whens and thens.

Last Version: 8.2.2

Release Date:

mockspresso-mockito-powermock

com.episode6.hackit.mockspresso : mockspresso-mockito-powermock

An extensible auto-mocker for java, designed to simplify your unit tests.

Last Version: 0.1.0

Release Date:

Last Version: 3.2.0.0-M2

Release Date:

Last Version: 3.2.12.0-RC2

Release Date:

Last Version: 1.2.3

Release Date:

Last Version: 1.5.0.0

Release Date:

jgiven-testng

com.tngtech.jgiven : jgiven-testng

Module to write JGiven tests with TestNG

Last Version: 1.2.2

Release Date:

quick-perf-testng

org.quickperf : quick-perf-testng

QuickPerf is a testing library for Java providing annotations to quickly evaluate some performance properties.

Last Version: 1.1.0

Release Date: