Since we wrote this post we didn't laze around. Check our latest announcement.
The Arquillian team is proud to announce the 1.0.0.Alpha2 release of the Arquillian Algeron Extension component!
Important note: This extension was called Arquillian Pact before version 1.0.0.Alpha5
, so you should use this name when pulling dependencies from Maven Central.
Arquillian Pact is an extension that provides an integration between Arquillian and Pact.
What’s new
Maven Loader
Now you can use your own Maven artifact to store contracts (pacts files). Then provider will resolve the artifact and use the files included there.
To use it simply import following dependency:
<dependency>
<groupId>org.arquillian.pact</groupId>
<artifactId>arquillian-pact-provider-maven-loader</artifactId>
</dependency>
For example, this is how you can get contracts from a jar file stored in Maven repository. It is important to note that Arquillian Pact always takes the latest version of jar in case of not specifying one concrete version.
@PactMavenDependency(value = "org.superbiz:contract:[1.0,]")
public class MavenLoaderTest {}
Git Loader
You can also fetch your contracts from Git repository. The provider will clone/pull the repo and execute the contracts found there.
To use it simply import following dependency:
<dependency>
<groupId>org.arquillian.pact</groupId>
<artifactId>arquillian-pact-provider-git-loader</artifactId>
</dependency>
For example, this is how you can get contracts form a public Git repository:
@PactGit("https://github.com/lordofthejars/starwarspact.git")
public class GitLoaderTest {}
Check @PactGit
annotation to see the options for configuring authentication or set a concrete directory inside Git repository.
Output Directory
When writing consumer tests you can now use pactReportDir
configuration property to set where contracts are stored.
For example, this is how you can generate contracts into target/contracts directory.
<extension qualifier="pact-consumer">
<property name="pactReportDir">target/contracts</property>
</extension>
Enrichments
You can use two new Target methods for executing provider tests:
@ArquillianResource
Target target;
target.testInteraction();
Or setting the URL directly instead of configuring it.
@ArquillianResource
Target target;
@ArquillianResource
URL webapp;
target.testInteraction(webapp);
In Alpha1, you need to pass as arguments to testInteraction
method the current consumer and the current interaction. These values were injected in test using @CurrentConsumer
and @CurrentInteraction
annotations.
With these two new methods it is not necessary you enrich the test anymore. Of course these enrichments still work and you can still use methods where consumer and interaction are required if you want more control on the execution.
What is Arquillian?
Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.
Release details
Published artifacts
org.arquillian.pact
-
org.arquillian.pact
»
arquillian-pact-consumer-api
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-consumer-core
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-consumer-spi
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-provider-api
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-provider-core
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-provider-spi
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-provider-pact-broker-loader
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-provider-maven-loader
jar
javadoc
pom
-
org.arquillian.pact
»
arquillian-pact-provider-git-loader
jar
javadoc
pom
Release notes and resolved issues
5
- Enhancement
-
Thanks to the following list of contributors:
Alex Soto, Eddú Meléndez Gonzales