Unit Testing

pact-jvm-provider-junit5_2.11

au.com.dius : pact-jvm-provider-junit5_2.11

# 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, "/")); } ``` ## 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. ## 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 |

Last Version: 3.5.24

Release Date:

diet4j-junit

org.diet4j : diet4j-junit

Distribute Maven JARs one module at a time, diet4j will automatically assemble them at run-time without needing gigantic JARs.

Last Version: 0.15

Release Date:

byteman-junit-rules

com.github.mahnkong : byteman-junit-rules

This project contains functionality allowing the usage of byteman in JUnit tests by providing JUnit rules (install byteman agent, load/unload of the rules) and some annotations (byteman setup for the tests).

Last Version: 1.0.3

Release Date:

MultithreadedTC

com.github.nruzic : multithreadedtc-junit4

Common POM definitions for java projects

Last Version: 1.0.2

Release Date:

Last Version: 1.0.9

Release Date:

Recursive Assertion JUnit 5

com.github.vladislavsevruk : recursive-assertion-junit5

This utility library helps to assert complex models using various settings and provide convenient error messages using JUnit 5 AssertAll mechanism.

Last Version: 1.0.1

Release Date:

Last Version: 0.3.2

Release Date:

com.peachapisecurity:tg-junit4

com.peachapisecurity : tg-junit4

Peach API Security JUnit4 Integration

Last Version: 1.5.41

Release Date:

Last Version: 4.8.3

Release Date:

marklogic-data-hub-junit5

com.marklogic : marklogic-data-hub-junit5

Supports testing Data Hub applications via JUnit5

Last Version: 5.7.2

Release Date:

Last Version: 1.6.0

Release Date:

testIT | WebTester - Support - JUnit 4.x

info.novatec.testit : webtester-support-junit4

A best practice framework for testing web based applications.

Last Version: 2.10.3

Release Date:

Xbase Junit Library

org.eclipse.xtext : org.eclipse.xtext.xbase.junit

Xtext is a framework for development of programming languages and domain-specific languages. With Xtext you define your language using a powerful grammar language. As a result you get a full infrastructure, including parser, linker, typechecker, compiler as well as editing support for Eclipse, IntelliJ IDEA and your favorite web browser. Xtend is a little language that compiles into idiomatic Java source code. You can use any existing Java library seamlessly from Xtend (and vice-versa). The compiled output is readable and pretty-printed, and tends to run as fast or faster than the equivalent handwritten Java code. It's the CoffeeScript for Java.

Last Version: 2.10.0

Release Date:

testIT | WebTester - Support - JUnit

info.novatec.testit : webtester-support-junit

A best practice framework for testing web based applications.

Last Version: 1.2.0

Release Date:

archetype-junit-spring-systemtest

com.fitbur.testify.archetype : archetype-junit-spring-systemtest

Creates a new quickstart project to system test Spring MVC application with Testify, JUnit, Mockito, and AssertJ.

Last Version: 0.1.3

Release Date:

junit4-parent

com.github.skjolber.mockito-rest-spring : junit4-parent

REST web-service mocking utility for Spring using JUnit and Mockito

Last Version: 1.0.3

Release Date:

korio-junit

com.soywiz : korio-junit

Korio: Kotlin cORoutines I/O : Streams + Async TCP Client/Server + Virtual File System for JVM, Node.JS and Browser

Last Version: 0.13.0

Release Date:

Last Version: 0.1.20

Release Date:

webtau-junit4-examples

org.testingisdocumenting.webtau : webtau-junit4-examples

WebTau - web test automation. REST/GraphQL/DB/CLI/UI testing framework.

Last Version: 1.48

Release Date:

junit5-kubernetes

com.github.jeanbaptistewatenberg.junit5kubernetes : rabbitmq

Use pod and other kubernetes object right form your junit5 tests.

Last Version: 2.3.1-beta

Release Date:

publishing

org.tatools : sunshine-junit4

"The package is Sunshine's adapter for JUnit 4 tests runner."

Last Version: 0.7.0

Release Date:

xtend-junit

com.github.oehme.xtend : xtend-junit

Makes using Junit4 even more fun with Xtend

Last Version: 0.0.2

Release Date:

Last Version: 1.0.0-RC1

Release Date:

Probe Dock Demo Junit integration

io.probedock.demo : probedock-demo-junit

Demonstration of an integration of Junit with Probe Dock.

Last Version: 0.2.0

Release Date:

JUnit Lambda Extensions

com.github.marschall : junit-lambda

JUnit extensions that make use of Java 8 lambdas.

Last Version: 0.3.0

Release Date:

Last Version: 1.3.0

Release Date:

Last Version: 99.99.999

Release Date:

schemaregistry-junit

io.github.data-rocks-team : schemaregistry-junit5

A library that provides an in-memory instance of Confluent Schema Registry to run your tests against.

Last Version: 0.1.1

Release Date:

Last Version: 1.0.2

Release Date:

smpp-server-mock-junit

com.github.mikesafonov : smpp-server-mock-junit

JUnit 5 extension to test smpp connection

Last Version: 1.5.0

Release Date:

deepsampler-junit-json

de.ppi : deepsampler-junit-json

This module provides annotations, to configure json samplers in junit tests.

Last Version: 2.1.0

Release Date:

JUnit5-Docker

com.github.faustxvi : junit5-docker

A JUnit5 extension that allows you to start containers from your tests

Last Version: 1.0.0

Release Date:

Last Version: 0.0.2

Release Date:

Last Version: 1.1.0

Release Date:

JZONbie

com.jonnymatts : jzonbie-junit4

HTTP client for JZONbie

Last Version: 5.1.0

Release Date:

Last Version: 1.0.0

Release Date:

Last Version: 1.0.5

Release Date:

Last Version: 1.0.3

Release Date:

thymeleaf-testing-junit

nz.net.ultraq.thymeleaf : thymeleaf-testing-junit

A Thymeleaf Testing / JUnit bridge to treat each Thymeleaf test file as a JUnit test.

Last Version: 5.0.0

Release Date:

Last Version: 1.0.5b

Release Date:

Last Version: 2.0.6-beta

Release Date:

Last Version: 1.6.6

Release Date: