<commit_before>---
date: 2016-09-29
author: lordofthejars
---

p. Arquillian Pact is an extension that provides an integration between Arquillian and "Pact":https://docs.pact.io/.

h3 What's new

p. <i class="icon-star"></i> Maven Loader

p. 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.

p. To use it simply import following dependency:

bc(prettify).. <dependency>
  <groupId>org.arquillian.pact</groupId>
  <artifactId>arquillian-pact-provider-maven-loader</artifactId>
</dependency>

p. 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.

bc(prettify).. @PactMavenDependency(value = "org.superbiz:contract:[1.0,]")
public class MavenLoaderTest {}

p. <i class="icon-star"></i> Git Loader

p. You can also fetch your contracts from Git repository. The provider will clone/pull the repo and execute the contracts found there.

p. To use it simply import following dependency:

bc(prettify).. <dependency>
  <groupId>org.arquillian.pact</groupId>
  <artifactId>arquillian-pact-provider-git-loader</artifactId>
</dependency>

p. For example, this is how you can get contracts form a public Git repository:

bc(prettify).. @PactGit("https://github.com/lordofthejars/starwarspact.git")
public class GitLoaderTest {}

p. Check __PactGit__ annotation "https://github.com/arquillian/arquillian-pact/blob/master/provider/git-loader/src/main/java/org/arquillian/pact/provider/loader/git/PactGit.java":https://github.com/arquillian/arquillian-pact/blob/master/provider/git-loader/src/main/java/org/arquillian/pact/provider/loader/git/PactGit.java to see the options for configuring authentication or set a concrete directory inside Git repo.

p. <i class="icon-star"></i> Output Directory

p. 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.

bc(prettify).. <extension qualifier="pact-consumer">
  <property name="pactReportDir">target/contracts</property>
</extension>

p. <i class="icon-star"></i> Enrichments

p. You can use two new Target methods for executing provider tests:

bc(prettify).. @ArquillianResource
Target target;

target.testInteraction();

p. Or setting the URL directly instead of configuring it.

bc(prettify).. @ArquillianResource
Target target;

@ArquillianResource
URL webapp;

target.testInteraction(webapp);

p. 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.

p. 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.<commit_msg>Fixes minor formatting issues in Pact release announcement<commit_after>---
date: 2016-09-29
author: lordofthejars
---

p. Arquillian Pact is an extension that provides an integration between Arquillian and "Pact":https://docs.pact.io/.

h3. What's new

p. <i class="icon-star"></i> Maven Loader

p. 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.

p. To use it simply import following dependency:

bc(prettify).. <dependency>
  <groupId>org.arquillian.pact</groupId>
  <artifactId>arquillian-pact-provider-maven-loader</artifactId>
</dependency>

p. 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.

bc(prettify).. @PactMavenDependency(value = "org.superbiz:contract:[1.0,]")
public class MavenLoaderTest {}

p. <i class="icon-star"></i> Git Loader

p. You can also fetch your contracts from Git repository. The provider will clone/pull the repo and execute the contracts found there.

p. To use it simply import following dependency:

bc(prettify).. <dependency>
  <groupId>org.arquillian.pact</groupId>
  <artifactId>arquillian-pact-provider-git-loader</artifactId>
</dependency>

p. For example, this is how you can get contracts form a public Git repository:

bc(prettify).. @PactGit("https://github.com/lordofthejars/starwarspact.git")
public class GitLoaderTest {}

p. Check "@@PactGit@ annotation":https://github.com/arquillian/arquillian-pact/blob/master/provider/git-loader/src/main/java/org/arquillian/pact/provider/loader/git/PactGit.java to see the options for configuring authentication or set a concrete directory inside Git repository.

p. <i class="icon-star"></i> Output Directory

p. 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.

bc(prettify).. <extension qualifier="pact-consumer">
  <property name="pactReportDir">target/contracts</property>
</extension>

p. <i class="icon-star"></i> Enrichments

p. You can use two new Target methods for executing provider tests:

bc(prettify).. @ArquillianResource
Target target;

target.testInteraction();

p. Or setting the URL directly instead of configuring it.

bc(prettify).. @ArquillianResource
Target target;

@ArquillianResource
URL webapp;

target.testInteraction(webapp);

p. 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.

p. 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.
{'fraction_non_alphanumeric': 0.09062905317769131, 'fraction_numerical': 0.0038910505836575876, 'mean_word_length': 4.886450381679389, 'pattern_counts': {'":': 4, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3735524', 'n_tokens_mistral': 1861, 'n_tokens_neox': 1749, 'n_words': 693}