Download provider-commons JAR file with all dependencies
resteasy-jackson-provider from group org.jboss.resteasy (version 3.0.1.Final)
Group: org.jboss.resteasy Artifact: resteasy-jackson-provider
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
org.eclipse.scada.hd.connection.provider from group org.eclipse.neoscada.core (version 0.1.0)
Eclipse SCADA HD Connection Provider (Incubation)
Group: org.eclipse.neoscada.core Artifact: org.eclipse.scada.hd.connection.provider
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
maven-scm-provider-gitexe from group org.apache.maven.scm (version 1.9.4)
Executable implementation for SCM Git Provider.
Group: org.apache.maven.scm Artifact: maven-scm-provider-gitexe
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
shedlock-provider-redis-jedis from group net.javacrumbs.shedlock (version 1.0.0)
Group: net.javacrumbs.shedlock Artifact: shedlock-provider-redis-jedis
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
jersey-test-framework-provider-jetty from group org.glassfish.jersey.test-framework.providers (version 2.22.1)
Jersey Test Framework - Jetty HTTP container
Group: org.glassfish.jersey.test-framework.providers Artifact: jersey-test-framework-provider-jetty
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
Artifact jersey-test-framework-provider-jetty
Group org.glassfish.jersey.test-framework.providers
Version 2.22.1
Group org.glassfish.jersey.test-framework.providers
Version 2.22.1
jackson-jaxrs-json-provider from group com.fasterxml.jackson.jaxrs (version 2.7.7)
Functionality to handle JSON input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding.
shedlock-provider-elasticsearch from group net.javacrumbs.shedlock (version 2.4.0)
Group: net.javacrumbs.shedlock Artifact: shedlock-provider-elasticsearch
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
pact-jvm-provider-spring_2.12 from group au.com.dius (version 3.5.8)
# Pact Spring/JUnit runner
## Overview
Library provides ability to play contract tests against a provider using Spring & JUnit.
This library is based on and references the JUnit package, so see the [Pact JUnit 4](../pact-jvm-provider-junit) or [Pact JUnit 5](../pact-jvm-provider-junit5) providers for more details regarding configuration using JUnit.
Supports:
- Standard ways to load pacts from folders and broker
- Easy way to change assertion strategy
- Spring Test MockMVC Controllers and ControllerAdvice using MockMvc standalone setup.
- MockMvc debugger output
- Multiple @State runs to test a particular Provider State multiple times
- **au.com.dius.pact.provider.junit.State** custom annotation - before each interaction that requires a state change,
all methods annotated by `@State` with appropriate the state listed will be invoked.
**NOTE:** For publishing provider verification results to a pact broker, make sure the Java system property `pact.provider.version`
is set with the version of your provider.
## Example of MockMvc test
```java
@RunWith(RestPactRunner.class) // Custom pact runner, child of PactRunner which runs only REST tests
@Provider("myAwesomeService") // Set up name of tested provider
@PactFolder("pacts") // Point where to find pacts (See also section Pacts source in documentation)
public class ContractTest {
//Create an instance of your controller. We cannot autowire this as we're not using (and don't want to use) a Spring test runner.
@InjectMocks
private AwesomeController awesomeController = new AwesomeController();
//Mock your service logic class. We'll use this to create scenarios for respective provider states.
@Mock
private AwesomeBusinessLogic awesomeBusinessLogic;
//Create an instance of your controller advice (if you have one). This will be passed to the MockMvcTarget constructor to be wired up with MockMvc.
@InjectMocks
private AwesomeControllerAdvice awesomeControllerAdvice = new AwesomeControllerAdvice();
//Create a new instance of the MockMvcTarget and annotate it as the TestTarget for PactRunner
@TestTarget
public final MockMvcTarget target = new MockMvcTarget();
@Before //Method will be run before each test of interaction
public void before() {
//initialize your mocks using your mocking framework
MockitoAnnotations.initMocks(this);
//configure the MockMvcTarget with your controller and controller advice
target.setControllers(awesomeController);
target.setControllerAdvice(awesomeControllerAdvice);
}
@State("default", "no-data") // Method will be run before testing interactions that require "default" or "no-data" state
public void toDefaultState() {
target.setRunTimes(3); //let's loop through this state a few times for a 3 data variants
when(awesomeBusinessLogic.getById(any(UUID.class)))
.thenReturn(myTestHelper.generateRandomReturnData(UUID.randomUUID(), ExampleEnum.ONE))
.thenReturn(myTestHelper.generateRandomReturnData(UUID.randomUUID(), ExampleEnum.TWO))
.thenReturn(myTestHelper.generateRandomReturnData(UUID.randomUUID(), ExampleEnum.THREE));
}
@State("error-case")
public void SingleUploadExistsState_Success() {
target.setRunTimes(1); //tell the runner to only loop one time for this state
//you might want to throw exceptions to be picked off by your controller advice
when(awesomeBusinessLogic.getById(any(UUID.class)))
.then(i -> { throw new NotCoolException(i.getArgumentAt(0, UUID.class).toString()); });
}
}
```
## Using a Spring runner (version 3.5.7+)
You can use `SpringRestPactRunner` instead of the default Pact runner to use the Spring test annotations. This will
allow you to inject or mock spring beans.
For example:
```java
@RunWith(SpringRestPactRunner.class)
@Provider("pricing")
@PactBroker(protocol = "https", host = "${pactBrokerHost}", port = "443",
authentication = @PactBrokerAuth(username = "${pactBrokerUser}", password = "${pactBrokerPassword}"))
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class PricingServiceProviderPactTest {
@MockBean
private ProductClient productClient; // This will replace the bean with a mock in the application context
@TestTarget
@SuppressWarnings(value = "VisibilityModifier")
public final Target target = new HttpTarget(8091);
@State("Product X010000021 exists")
public void setupProductX010000021() throws IOException {
reset(productClient);
ProductBuilder product = new ProductBuilder()
.withProductCode("X010000021");
when(productClient.fetch((Set<String>) argThat(contains("X010000021")), any())).thenReturn(product);
}
@State("the product code X00001 can be priced")
public void theProductCodeX00001CanBePriced() throws IOException {
reset(productClient);
ProductBuilder product = new ProductBuilder()
.withProductCode("X00001");
when(productClient.find((Set<String>) argThat(contains("X00001")), any())).thenReturn(product);
}
}
```
### Using Spring Context Properties (version 3.5.14+)
From version 3.5.14 onwards, the SpringRestPactRunner will look up any annotation expressions (like `${pactBrokerHost}`)
above) from the Spring context. For Springboot, this will allow you to define the properties in the application test properties.
For instance, if you create the following `application.yml` in the test resources:
```yaml
pactbroker:
host: "your.broker.local"
port: "443"
protocol: "https"
auth:
username: "<your broker username>"
password: "<your broker password>"
```
Then you can use the defaults on the `@PactBroker` annotation.
```java
@RunWith(SpringRestPactRunner.class)
@Provider("My Service")
@PactBroker(
authentication = @PactBrokerAuth(username = "${pactbroker.auth.username}", password = "${pactbroker.auth.password}")
)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class PactVerificationTest {
```
### Using a random port with a Springboot test (version 3.5.14+)
If you use a random port in a springboot test (by setting `SpringBootTest.WebEnvironment.RANDOM_PORT`), you can use the
`SpringBootHttpTarget` which will get the application port from the spring application context.
For example:
```java
@RunWith(SpringRestPactRunner.class)
@Provider("My Service")
@PactBroker
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class PactVerificationTest {
@TestTarget
public final Target target = new SpringBootHttpTarget();
}
```
Group: au.com.dius Artifact: pact-jvm-provider-spring_2.12
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
play2-provider-play23 from group com.google.code.play2-maven-plugin (version 1.0.0-rc3)
Play! 2.x Provider for Play! 2.3.x
Group: com.google.code.play2-maven-plugin Artifact: play2-provider-play23
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
diozero-provider-bbbiolib from group com.diozero (version 0.11)
Group: com.diozero Artifact: diozero-provider-bbbiolib
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
osgi.enroute.web.simple.provider from group org.osgi (version 2.0.0)
Provides a simple implementation of the OSGi enRoute webserver.
org.eclipse.ecf.provider.filetransfer from group com.github.veithen.cosmos.bootstrap (version 0.3)
Group: com.github.veithen.cosmos.bootstrap Artifact: org.eclipse.ecf.provider.filetransfer
Show documentation Show source
Show documentation Show source
1 downloads
osgi.enroute.gogo.shell.provider from group org.osgi (version 2.0.0)
An adaption of the famous Apache Felix Gogo shell that uses JLine to provide command history and line editing features. Since the Eclipse terminal does not support line editing, it works there as usual.It was adapted by Neil Bartlett.
1 downloads
resteasy-jackson2-provider from group org.jboss.resteasy (version 3.0.6.Final)
Group: org.jboss.resteasy Artifact: resteasy-jackson2-provider
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
pact-jvm-provider-junit5_2.11 from group au.com.dius (version 3.5.16)
# 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 |
Group: au.com.dius Artifact: pact-jvm-provider-junit5_2.11
There is no JAR file uploaded. A download is not possible! Please choose another version.
1 downloads
Page 28 from 51 (items total 758)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy