All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Download JAR files tagged by list with all dependencies

Search JAR files by class name

raceSearch from group nz.ac.waikato.cms.weka (version 1.0.2)

Races the cross validation error of competing attribute subsets. Use in conjuction with a ClassifierSubsetEval. RaceSearch has four modes: forward selection races all single attribute additions to a base set (initially no attributes), selects the winner to become the new base set and then iterates until there is no improvement over the base set. Backward elimination is similar but the initial base set has all attributes included and races all single attribute deletions. Schemata search is a bit different. Each iteration a series of races are run in parallel. Each race in a set determines whether a particular attribute should be included or not---ie the race is between the attribute being "in" or "out". The other attributes for this race are included or excluded randomly at each point in the evaluation. As soon as one race has a clear winner (ie it has been decided whether a particular attribute should be inor not) then the next set of races begins, using the result of the winning race from the previous iteration as new base set. Rank race first ranks the attributes using an attribute evaluator and then races the ranking. The race includes no attributes, the top ranked attribute, the top two attributes, the top three attributes, etc. It is also possible to generate a raked list of attributes through the forward racing process. If generateRanking is set to true then a complete forward race will be run---that is, racing continues until all attributes have been selected. The order that they are added in determines a complete ranking of all the attributes. Racing uses paired and unpaired t-tests on cross-validation errors of competing subsets. When there is a significant difference between the means of the errors of two competing subsets then the poorer of the two can be eliminated from the race. Similarly, if there is no significant difference between the mean errors of two competing subsets and they are within some threshold of each other, then one can be eliminated from the race.

Group: nz.ac.waikato.cms.weka Artifact: raceSearch
Show all versions Show documentation Show source 
 

0 downloads
Artifact raceSearch
Group nz.ac.waikato.cms.weka
Version 1.0.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/raceSearch
License GNU General Public License 3
Dependencies amount 2
Dependencies weka-dev, classifierBasedAttributeSelection,
There are maybe transitive dependencies!

tagmycode-netbeans from group com.tagmycode (version 2.3.0)

Provides the support for <a href="https://tagmycode.com">TagMyCode</a>. This plugin allows you to manage your own snippets.<br/> <br/> Features:<br/> * Add snippets: you can save your code snippets including description, language, and tags<br/> * List snippets (CRUD): snippets are stored locally and you can filter, sort, create, modify, edit or delete them directly from the IDE<br/> * Quick search: you can search your snippets and insert them directly into the document<br/> <br/> CHANGELOG:<br/> <br/> 2.3.0 (released 2020-07-26)<br/> * published plugin into Apache NetBeans Plugin Portal<br/> * filter snippets by languages<br/> <br/> 2.2.1 (released 2018-01-10)<br/> * Quick Search dialog is now resizable</br> * fixed syntax highlight for PHP and HTML</br> * if refresh token is not valid user will be automatically logged out</br> </br> 2.2.0 (released 2017-11-06)<br/> * snippets management works in offline mode<br/> * autodetect language on new snippet<br/> * added settings dialog with editor theme and font size option<br/> * added title and description to snippet view<br/> * changed open browser class<br/> * text can be dragged into table to create a new snippet<br/> * snippets can be dragged directly into editor and the code are copied<br/> * added "save as file" feature<br/> * added "clone snippet" feature<br/> * added "snippet properties" dialog<br/> * detect binary file<br/> <br/> 2.1.0 (released 2017-04-24)<br/> * moved error messages from dialog to Netbeans Notification Log<br/> * added welcome panel<br/> * about dialog shows plugin version and framework version<br/> * moved storage from JSON to SQL<br/> <br/> 2.0 (released 2016-07-11)<br/> * new user interface<br/> * list of snippets stored locally<br/> * syntax highlight powered by <a href="http://bobbylight.github.io/RSyntaxTextArea/">RSyntaxTextArea</a><br/> * snippets are synchronized with server<br/> * filter snippets<br/> * quick search feature<br/> * insert selected snippet at cursor in document<br/> <br/> 1.1.3 (released 2015-12-18)<br/> * Fix for NetBeans 8.1<br/> <br/> 1.1.2 (released 2014-10-03)<br/> * Switched authentication from OAuth 1.0a to OAuth 2<br/> * Console write also snippet title when new snippet is created (thanks to bejoy)<br/> <br/> 1.1 (released 2014-08-19)<br/> * Added "Search snippets" feature<br/> * Fixed some minor bugs<br/> <br/> 1.0 (released 2014-04-14)<br/> * First release with feature "Create snippet"<br/>

Group: com.tagmycode Artifact: tagmycode-netbeans
Show documentation Show source 
 

0 downloads
Artifact tagmycode-netbeans
Group com.tagmycode
Version 2.3.0
Last update 06. September 2020
Organization not specified
URL https://tagmycode.com
License Apache License 2.0
Dependencies amount 18
Dependencies commons-lang3, rsyntaxtextarea, guava, org-netbeans-api-annotations-common, org-openide-awt, org-netbeans-modules-settings, org-openide-dialogs, org-netbeans-modules-editor, org-netbeans-modules-keyring, org-openide-nodes, org-openide-util, org-openide-loaders, org-openide-windows, org-openide-util-ui, org-openide-text, org-netbeans-api-progress, log4j, tagmycode-plugin-framework,
There are maybe transitive dependencies!

pact-jvm-server_2.12 from group au.com.dius (version 3.6.15)

Pact server =========== The pact server is a stand-alone interactions recorder and verifier, aimed at clients that are non-JVM or non-Ruby based. The pact client for that platform will need to be implemented, but it only be responsible for generating the `JSON` interactions, running the tests and communicating with the server. The server implements a `JSON` `REST` Admin API with the following endpoints. / -&gt; For diagnostics, currently returns a list of ports of the running mock servers. /create -&gt; For initialising a test server and submitting the JSON interactions. It returns a port /complete -&gt; For finalising and verifying the interactions with the server. It writes the `JSON` pact file to disk. ## Running the server ### Versions 2.2.6+ Pact server takes the following parameters: ``` Usage: pact-jvm-server [options] [port] port port to run on (defaults to 29999) --help prints this usage text -h &lt;value&gt; | --host &lt;value&gt; host to bind to (defaults to localhost) -l &lt;value&gt; | --mock-port-lower &lt;value&gt; lower bound to allocate mock ports (defaults to 20000) -u &lt;value&gt; | --mock-port-upper &lt;value&gt; upper bound to allocate mock ports (defaults to 40000) -d | --daemon run as a daemon process -v &lt;value&gt; | --pact-version &lt;value&gt; pact version to generate for (2 or 3) -k &lt;value&gt; | --keystore-path &lt;value&gt; Path to keystore -p &lt;value&gt; | --keystore-password &lt;value&gt; Keystore password -s &lt;value&gt; | --ssl-port &lt;value&gt; Ssl port the mock server should run on. lower and upper bounds are ignored --debug run with debug logging ``` ### Using trust store 3.4.0+ Trust store can be used. However, it is limited to a single port for the time being. ### Prior to version 2.2.6 Pact server takes one optional parameter, the port number to listen on. If not provided, it will listen on 29999. It requires an active console to run. ### Using a distribution archive You can download a [distribution from maven central](http://search.maven.org/remotecontent?filepath=au/com/dius/pact-jvm-server_2.11/2.2.4/). There is both a ZIP and TAR archive. Unpack it to a directory of choice and then run the script in the bin directory. ### Building a distribution bundle You can build an application bundle with gradle by running (for 2.11 version): $ ./gradlew :pact-jvm-server_2.11:installdist This will create an app bundle in `build/2.11/install/pact-jvm-server_2.11`. You can then execute it with: $ java -jar pact-jvm-server/build/2.10/install/pact-jvm-server_2.11/lib/pact-jvm-server_2.11-3.2.11.jar or with the generated bundle script file: $ pact-jvm-server/build/2.11/install/pact-jvm-server_2.11/bin/pact-jvm-server_2.11 By default will run on port `29999` but a port number can be optionally supplied. ### Running it with docker You can use a docker image to execute the mock server as a docker container. $ docker run -d -p 8080:8080 -p 20000-20010:20000-20010 uglyog/pact-jvm-server This will run the main server on port 8080, and each created mock server on ports 20000-20010. You can map the ports to any you require. ## Life cycle The following actions are expected to occur * The client calls `/create` to initialise a server with the expected `JSON` interactions and state * The admin server will start a mock server on a random port and return the port number in the response * The client will execute its interaction tests against the mock server with the supplied port * Once finished, the client will call `/complete&apos; on the Admin API, posting the port number * The pact server will verify the interactions and write the `JSON` `pact` file to disk under `/target` * The mock server running on the supplied port will be shutdown. ## Endpoints ### /create The client will need `POST` to `/create` the generated `JSON` interactions, also providing a state as a query parameter and a path. For example: POST http://localhost:29999/create?state=NoUsers&amp;path=/sub/ref/path &apos;{ &quot;provider&quot;: { &quot;name&quot;: &quot;Animal_Service&quot;}, ... }&apos; This will create a new running mock service provider on a randomly generated port. The port will be returned in the `201` response: { &quot;port&quot; : 34423 } But you can also reference the path from `/sub/ref/path` using the server port. The service will not strip the prefix path, but instead will use it as a differentiator. If your services do not have differences in the prefix of their path, then you will have to use the port method. ### /complete Once the client has finished running its tests against the mock server on the supplied port (in this example port `34423`) the client will need to `POST` to `/complete` the port number of the mock server that was used. For example: POST http://localhost:29999/complete &apos;{ &quot;port&quot; : 34423 }&apos; This will cause the Pact server to verify the interactions, shutdown the mock server running on that port and writing the pact `JSON` file to disk under the `target` directory. ### / The `/` endpoint is for diagnostics and to check that the pact server is running. It will return all the currently running mock servers port numbers. For example: GET http://localhost:29999/ &apos;{ &quot;ports&quot;: [23443,43232] }&apos;

Group: au.com.dius Artifact: pact-jvm-server_2.12
Show all versions Show documentation Show source 
 

2 downloads
Artifact pact-jvm-server_2.12
Group au.com.dius
Version 3.6.15
Last update 29. April 2020
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 4
Dependencies pact-jvm-consumer_2.12, logback-core, logback-classic, scopt_2.12,
There are maybe transitive dependencies!

pact-jvm-server from group au.com.dius (version 4.0.10)

Pact server =========== The pact server is a stand-alone interactions recorder and verifier, aimed at clients that are non-JVM or non-Ruby based. The pact client for that platform will need to be implemented, but it only be responsible for generating the `JSON` interactions, running the tests and communicating with the server. The server implements a `JSON` `REST` Admin API with the following endpoints. / -&gt; For diagnostics, currently returns a list of ports of the running mock servers. /create -&gt; For initialising a test server and submitting the JSON interactions. It returns a port /complete -&gt; For finalising and verifying the interactions with the server. It writes the `JSON` pact file to disk. ## Running the server ### Versions 2.2.6+ Pact server takes the following parameters: ``` Usage: pact-jvm-server [options] [port] port port to run on (defaults to 29999) --help prints this usage text -h &lt;value&gt; | --host &lt;value&gt; host to bind to (defaults to localhost) -l &lt;value&gt; | --mock-port-lower &lt;value&gt; lower bound to allocate mock ports (defaults to 20000) -u &lt;value&gt; | --mock-port-upper &lt;value&gt; upper bound to allocate mock ports (defaults to 40000) -d | --daemon run as a daemon process -v &lt;value&gt; | --pact-version &lt;value&gt; pact version to generate for (2 or 3) -k &lt;value&gt; | --keystore-path &lt;value&gt; Path to keystore -p &lt;value&gt; | --keystore-password &lt;value&gt; Keystore password -s &lt;value&gt; | --ssl-port &lt;value&gt; Ssl port the mock server should run on. lower and upper bounds are ignored --debug run with debug logging ``` ### Using trust store 3.4.0+ Trust store can be used. However, it is limited to a single port for the time being. ### Prior to version 2.2.6 Pact server takes one optional parameter, the port number to listen on. If not provided, it will listen on 29999. It requires an active console to run. ### Using a distribution archive You can download a [distribution from maven central](http://search.maven.org/remotecontent?filepath=au/com/dius/pact-jvm-server_2.11/2.2.4/). There is both a ZIP and TAR archive. Unpack it to a directory of choice and then run the script in the bin directory. ### Building a distribution bundle You can build an application bundle with gradle by running (for 2.11 version): $ ./gradlew :pact-jvm-server_2.11:installdist This will create an app bundle in `build/2.11/install/pact-jvm-server_2.11`. You can then execute it with: $ java -jar pact-jvm-server/build/2.10/install/pact-jvm-server_2.11/lib/pact-jvm-server_2.11-3.2.11.jar or with the generated bundle script file: $ pact-jvm-server/build/2.11/install/pact-jvm-server_2.11/bin/pact-jvm-server_2.11 By default will run on port `29999` but a port number can be optionally supplied. ### Running it with docker You can use a docker image to execute the mock server as a docker container. $ docker run -d -p 8080:8080 -p 20000-20010:20000-20010 uglyog/pact-jvm-server This will run the main server on port 8080, and each created mock server on ports 20000-20010. You can map the ports to any you require. ## Life cycle The following actions are expected to occur * The client calls `/create` to initialise a server with the expected `JSON` interactions and state * The admin server will start a mock server on a random port and return the port number in the response * The client will execute its interaction tests against the mock server with the supplied port * Once finished, the client will call `/complete&apos; on the Admin API, posting the port number * The pact server will verify the interactions and write the `JSON` `pact` file to disk under `/target` * The mock server running on the supplied port will be shutdown. ## Endpoints ### /create The client will need `POST` to `/create` the generated `JSON` interactions, also providing a state as a query parameter and a path. For example: POST http://localhost:29999/create?state=NoUsers&amp;path=/sub/ref/path &apos;{ &quot;provider&quot;: { &quot;name&quot;: &quot;Animal_Service&quot;}, ... }&apos; This will create a new running mock service provider on a randomly generated port. The port will be returned in the `201` response: { &quot;port&quot; : 34423 } But you can also reference the path from `/sub/ref/path` using the server port. The service will not strip the prefix path, but instead will use it as a differentiator. If your services do not have differences in the prefix of their path, then you will have to use the port method. ### /complete Once the client has finished running its tests against the mock server on the supplied port (in this example port `34423`) the client will need to `POST` to `/complete` the port number of the mock server that was used. For example: POST http://localhost:29999/complete &apos;{ &quot;port&quot; : 34423 }&apos; This will cause the Pact server to verify the interactions, shutdown the mock server running on that port and writing the pact `JSON` file to disk under the `target` directory. ### / The `/` endpoint is for diagnostics and to check that the pact server is running. It will return all the currently running mock servers port numbers. For example: GET http://localhost:29999/ &apos;{ &quot;ports&quot;: [23443,43232] }&apos;

Group: au.com.dius Artifact: pact-jvm-server
Show all versions Show documentation Show source 
 

0 downloads
Artifact pact-jvm-server
Group au.com.dius
Version 4.0.10
Last update 18. April 2020
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!

pact-jvm-server_2.11 from group au.com.dius (version 3.5.17)

Pact server =========== The pact server is a stand-alone interactions recorder and verifier, aimed at clients that are non-JVM or non-Ruby based. The pact client for that platform will need to be implemented, but it only be responsible for generating the `JSON` interactions, running the tests and communicating with the server. The server implements a `JSON` `REST` Admin API with the following endpoints. / -&gt; For diagnostics, currently returns a list of ports of the running mock servers. /create -&gt; For initialising a test server and submitting the JSON interactions. It returns a port /complete -&gt; For finalising and verifying the interactions with the server. It writes the `JSON` pact file to disk. ## Running the server ### Versions 2.2.6+ Pact server takes the following parameters: ``` Usage: pact-jvm-server [options] [port] port port to run on (defaults to 29999) --help prints this usage text -h &lt;value&gt; | --host &lt;value&gt; host to bind to (defaults to localhost) -l &lt;value&gt; | --mock-port-lower &lt;value&gt; lower bound to allocate mock ports (defaults to 20000) -u &lt;value&gt; | --mock-port-upper &lt;value&gt; upper bound to allocate mock ports (defaults to 40000) -d | --daemon run as a daemon process -v &lt;value&gt; | --pact-version &lt;value&gt; pact version to generate for (2 or 3) -k &lt;value&gt; | --keystore-path &lt;value&gt; Path to keystore -p &lt;value&gt; | --keystore-password &lt;value&gt; Keystore password -s &lt;value&gt; | --ssl-port &lt;value&gt; Ssl port the mock server should run on. lower and upper bounds are ignored --debug run with debug logging ``` ### Using trust store 3.4.0+ Trust store can be used. However, it is limited to a single port for the time being. ### Prior to version 2.2.6 Pact server takes one optional parameter, the port number to listen on. If not provided, it will listen on 29999. It requires an active console to run. ### Using a distribution archive You can download a [distribution from maven central](http://search.maven.org/remotecontent?filepath=au/com/dius/pact-jvm-server_2.11/2.2.4/). There is both a ZIP and TAR archive. Unpack it to a directory of choice and then run the script in the bin directory. ### Building a distribution bundle You can build an application bundle with gradle by running (for 2.11 version): $ ./gradlew :pact-jvm-server_2.11:installdist This will create an app bundle in `build/2.11/install/pact-jvm-server_2.11`. You can then execute it with: $ java -jar pact-jvm-server/build/2.10/install/pact-jvm-server_2.11/lib/pact-jvm-server_2.11-3.2.11.jar or with the generated bundle script file: $ pact-jvm-server/build/2.11/install/pact-jvm-server_2.11/bin/pact-jvm-server_2.11 By default will run on port `29999` but a port number can be optionally supplied. ### Running it with docker You can use a docker image to execute the mock server as a docker container. $ docker run -d -p 8080:8080 -p 20000-20010:20000-20010 uglyog/pact-jvm-server This will run the main server on port 8080, and each created mock server on ports 20000-20010. You can map the ports to any you require. ## Life cycle The following actions are expected to occur * The client calls `/create` to initialise a server with the expected `JSON` interactions and state * The admin server will start a mock server on a random port and return the port number in the response * The client will execute its interaction tests against the mock server with the supplied port * Once finished, the client will call `/complete&apos; on the Admin API, posting the port number * The pact server will verify the interactions and write the `JSON` `pact` file to disk under `/target` * The mock server running on the supplied port will be shutdown. ## Endpoints ### /create The client will need `POST` to `/create` the generated `JSON` interactions, also providing a state as a query parameter and a path. For example: POST http://localhost:29999/create?state=NoUsers&amp;path=/sub/ref/path &apos;{ &quot;provider&quot;: { &quot;name&quot;: &quot;Animal_Service&quot;}, ... }&apos; This will create a new running mock service provider on a randomly generated port. The port will be returned in the `201` response: { &quot;port&quot; : 34423 } But you can also reference the path from `/sub/ref/path` using the server port. The service will not strip the prefix path, but instead will use it as a differentiator. If your services do not have differences in the prefix of their path, then you will have to use the port method. ### /complete Once the client has finished running its tests against the mock server on the supplied port (in this example port `34423`) the client will need to `POST` to `/complete` the port number of the mock server that was used. For example: POST http://localhost:29999/complete &apos;{ &quot;port&quot; : 34423 }&apos; This will cause the Pact server to verify the interactions, shutdown the mock server running on that port and writing the pact `JSON` file to disk under the `target` directory. ### / The `/` endpoint is for diagnostics and to check that the pact server is running. It will return all the currently running mock servers port numbers. For example: GET http://localhost:29999/ &apos;{ &quot;ports&quot;: [23443,43232] }&apos;

Group: au.com.dius Artifact: pact-jvm-server_2.11
Show all versions Show documentation Show source 
 

1 downloads
Artifact pact-jvm-server_2.11
Group au.com.dius
Version 3.5.17
Last update 03. June 2018
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 11
Dependencies kotlin-stdlib-jre8, kotlin-reflect, slf4j-api, groovy-all, kotlin-logging, scala-library, scala-logging_2.11, pact-jvm-consumer_2.11, logback-core, logback-classic, scopt_2.11,
There are maybe transitive dependencies!

pact-jvm-server_2.10 from group au.com.dius (version 2.4.20)

Pact server =========== The pact server is a stand-alone interactions recorder and verifier, aimed at clients that are non-JVM or non-Ruby based. The pact client for that platform will need to be implemented, but it only be responsible for generating the `JSON` interactions, running the tests and communicating with the server. The server implements a `JSON` `REST` Admin API with the following endpoints. / -&gt; For diagnostics, currently returns a list of ports of the running mock servers. /create -&gt; For initialising a test server and submitting the JSON interactions. It returns a port /complete -&gt; For finalising and verifying the interactions with the server. It writes the `JSON` pact file to disk. ## Running the server ### Versions 2.2.6+ Pact server takes the following parameters: ``` Usage: pact-jvm-server [options] [port] port port to run on (defaults to 29999) --help prints this usage text -h &lt;value&gt; | --host &lt;value&gt; host to bind to (defaults to localhost) -l &lt;value&gt; | --mock-port-lower &lt;value&gt; lower bound to allocate mock ports (defaults to 20000) -u &lt;value&gt; | --mock-port-upper &lt;value&gt; upper bound to allocate mock ports (defaults to 40000) -d | --daemon run as a daemon process --debug run with debug logging ``` ### Prior to version 2.2.6 Pact server takes one optional parameter, the port number to listen on. If not provided, it will listen on 29999. It requires an active console to run. ### Using a distribution archive You can download a [distribution from maven central](http://search.maven.org/remotecontent?filepath=au/com/dius/pact-jvm-server_2.11/2.2.4/). There is both a ZIP and TAR archive. Unpack it to a directory of choice and then run the script in the bin directory. ### Building a distribution bundle You can build an application bundle with gradle by running (for 2.11 version): $ ./gradlew :pact-jvm-server_2.11:installdist This will create an app bundle in `build/2.11/install/pact-jvm-server_2.11`. You can then execute it with: $ java -jar pact-jvm-server/build/2.10/install/pact-jvm-server_2.11/lib/pact-jvm-server_2.11-2.2.4.jar or with the generated bundle script file: $ pact-jvm-server/build/2.11/install/pact-jvm-server_2.11/bin/pact-jvm-server_2.11 By default will run on port `29999` but a port number can be optionally supplied. ### Running it with docker You can use a docker image to execute the mock server as a docker container. $ docker run -d -p 8080:8080 -p 20000-20010:20000-20010 uglyog/pact-jvm-server This will run the main server on port 8080, and each created mock server on ports 20000-20010. You can map the ports to any you require. ## Life cycle The following actions are expected to occur * The client calls `/create` to initialise a server with the expected `JSON` interactions and state * The admin server will start a mock server on a random port and return the port number in the response * The client will execute its interaction tests against the mock server with the supplied port * Once finished, the client will call `/complete&apos; on the Admin API, posting the port number * The pact server will verify the interactions and write the `JSON` `pact` file to disk under `/target` * The mock server running on the supplied port will be shutdown. ## Endpoints ### /create The client will need `POST` to `/create` the generated `JSON` interactions, also providing a state as a query parameter. For example: POST http://localhost:29999/create?state=NoUsers &apos;{ &quot;provider&quot;: { &quot;name&quot;: &quot;Animal_Service&quot;}, ... }&apos; This will create a new running mock service provider on a randomly generated port. The port will be returned in the `201` response: { &quot;port&quot; : 34423 } ### /complete Once the client has finished running its tests against the mock server on the supplied port (in this example port `34423`) the client will need to `POST` to `/complete` the port number of the mock server that was used. For example: POST http://localhost:29999/complete &apos;{ &quot;port&quot; : 34423 }&apos; This will cause the Pact server to verify the interactions, shutdown the mock server running on that port and writing the pact `JSON` file to disk under the `target` directory. ### / The `/` endpoint is for diagnostics and to check that the pact server is running. It will return all the currently running mock servers port numbers. For example: GET http://localhost:29999/ &apos;{ &quot;ports&quot;: [23443,43232] }&apos;

Group: au.com.dius Artifact: pact-jvm-server_2.10
Show all versions Show documentation Show source 
 

0 downloads
Artifact pact-jvm-server_2.10
Group au.com.dius
Version 2.4.20
Last update 14. April 2018
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 6
Dependencies slf4j-api, scala-library, pact-jvm-consumer_2.10, logback-core, logback-classic, scopt_2.10,
There are maybe transitive dependencies!

pact-jvm-provider_2.10 from group au.com.dius (version 2.4.20)

Pact provider ============= sub project of https://github.com/DiUS/pact-jvm The pact provider is responsible for verifying that an API provider adheres to a number of pacts authored by its clients This library provides the basic tools required to automate the process, and should be usable on its own in many instances. Framework and build tool specific bindings will be provided in separate libraries that build on top of this core functionality. ### Running Pacts Main takes 2 arguments: The first is the root folder of your pact files (all .json files in root and subfolders are assumed to be pacts) The second is the location of your pact config json file. ### Pact config The pact config is a simple mapping of provider names to endpoint url&apos;s paths will be appended to endpoint url&apos;s when interactions are attempted for an example see: https://github.com/DiUS/pact-jvm/blob/master/pact-jvm-provider/src/test/resources/pact-config.json ### Provider State Before each interaction is executed, the provider under test will have the opportunity to enter a state. Generally the state maps to a set of fixture data for mocking out services that the provider is a consumer of (they will have their own pacts) The pact framework will instruct the test server to enter that state by sending: POST &quot;${config.stateChangeUrl.url}/setup&quot; { &quot;state&quot; : &quot;${interaction.stateName}&quot; } ### An example of running provider verification with junit This example uses java, junit and hamcrest matchers to run the provider verification. As the provider service is a DropWizard application, it uses the DropwizardAppRule to startup the service before running any test. Warning: It only grabs the first interaction from the pact file with the consumer, where there could be many. (This could possibly be solved with a parameterized test) ```java public class PactJVMProviderJUnitTest { @ClassRule public static TestRule startServiceRule = new DropwizardAppRule&lt;DropwizardAppConfig&gt;(DropwizardApp.class, &quot;config.yml&quot;); private static ProviderInfo serviceProvider; private static Pact testConsumerPact; @BeforeClass public static void setupProvider() { serviceProvider = new ProviderInfo(&quot;Dropwizard App&quot;); serviceProvider.setProtocol(&quot;http&quot;); serviceProvider.setHost(&quot;localhost&quot;); serviceProvider.setPort(8080); serviceProvider.setPath(&quot;/&quot;); ConsumerInfo consumer = new ConsumerInfo(); consumer.setName(&quot;test_consumer&quot;); consumer.setPactFile(new File(&quot;target/pacts/ping_client-ping_service.json&quot;)); // serviceProvider.getConsumers().add(consumer); testConsumerPact = (Pact) new PactReader().loadPact(consumer.getPactFile()); } @Test @SuppressWarnings(&quot;unchecked&quot;) public void runConsumerPacts() { //grab the first interaction from the pact with consumer List&lt;Interaction&gt; interactions = scala.collection.JavaConversions.seqAsJavaList(testConsumerPact.interactions()); Interaction interaction1 = interactions.get(0); //setup any provider state //setup the client and interaction to fire against the provider ProviderClient client = new ProviderClient(); client.setProvider(serviceProvider); client.setRequest(interaction1.request()); Map&lt;String, Object&gt; clientResponse = (Map&lt;String, Object&gt;) client.makeRequest(); Map&lt;String, Object&gt; result = (Map&lt;String, Object&gt;) ResponseComparison.compareResponse(interaction1.response(), clientResponse, (int) clientResponse.get(&quot;statusCode&quot;), (Map) clientResponse.get(&quot;headers&quot;), (String) clientResponse.get(&quot;data&quot;)); //assert all good assertThat(result.get(&quot;method&quot;), is(true)); // method type matches Map headers = (Map) result.get(&quot;headers&quot;); //headers match headers.forEach( (k, v) -&gt; assertThat(format(&quot;Header: [%s] does not match&quot;, k), v, org.hamcrest.Matchers.equalTo(true)) ); assertThat((Collection&lt;Object&gt;)((Map)result.get(&quot;body&quot;)).values(), org.hamcrest.Matchers.hasSize(0)); // empty list of body mismatches } } ``` ### An example of running provider verification with spock This example uses groovy and spock to run the provider verification. Again the provider service is a DropWizard application, and is using the DropwizardAppRule to startup the service. This example runs all interactions using spocks Unroll feature ```groovy class PactJVMProviderSpockSpec extends Specification { @ClassRule @Shared TestRule startServiceRule = new DropwizardAppRule&lt;DropwizardAppConfig&gt;(DropwizardApp.class, &quot;config.yml&quot;); @Shared ProviderInfo serviceProvider @Shared Pact testConsumerPact def setupSpec() { serviceProvider = new ProviderInfo(&quot;Dropwizard App&quot;) serviceProvider.protocol = &quot;http&quot; serviceProvider.host = &quot;localhost&quot; serviceProvider.port = 8080; serviceProvider.path = &quot;/&quot; def consumer = serviceProvider.hasPactWith(&quot;ping_consumer&quot;, { pactFile = new File(&apos;target/pacts/ping_client-ping_service.json&apos;) }) testConsumerPact = (Pact) new PactReader().loadPact(consumer.getPactFile()); } def cleanup() { //cleanup provider state //ie. db.truncateAllTables() } def cleanupSpec() { //cleanup provider } @Unroll def &quot;Provider Pact - With Consumer&quot;() { given: //setup provider state // ie. db.setupRecords() // serviceProvider.requestFilter = { req -&gt; // req.addHeader(&apos;Authorization&apos;, token) // } when: ProviderClient client = new ProviderClient(provider: serviceProvider, request: interaction.request()) Map clientResponse = (Map) client.makeRequest() Map result = (Map) ResponseComparison.compareResponse(interaction.response(), clientResponse, clientResponse.statusCode, clientResponse.headers, clientResponse.data) then: // method matches result.method == true // headers all match, spock needs the size checked before // asserting each result if (result.headers.size() &gt; 0) { result.headers.each() { k, v -&gt; assert v == true } } // empty list of body mismatches result.body.size() == 0 where: interaction &lt;&lt; scala.collection.JavaConversions.seqAsJavaList(testConsumerPact.interactions()) } } ```

Group: au.com.dius Artifact: pact-jvm-provider_2.10
Show all versions Show documentation Show source 
 

2 downloads
Artifact pact-jvm-provider_2.10
Group au.com.dius
Version 2.4.20
Last update 14. April 2018
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 13
Dependencies slf4j-api, scala-library, pact-jvm-model, pact-jvm-matchers_2.10, scalatest_2.10, commons-io, groovy-all, jansi, http-builder, httpclient, reflections, unfiltered-netty-server_2.10, dispatch-core_2.10,
There are maybe transitive dependencies!

pact-jvm-provider-lein_2.12 from group au.com.dius (version 3.6.15)

# Leiningen plugin to verify a provider [version 2.2.14+, 3.0.3+] Leiningen plugin for verifying pacts against a provider. The plugin provides a `pact-verify` task which will verify all configured pacts against your provider. ## To Use It ### 1. Add the plugin to your project plugins, preferably in it&apos;s own profile. ```clojure :profiles { :pact { :plugins [[au.com.dius/pact-jvm-provider-lein_2.11 &quot;3.2.11&quot; :exclusions [commons-logging]]] :dependencies [[ch.qos.logback/logback-core &quot;1.1.3&quot;] [ch.qos.logback/logback-classic &quot;1.1.3&quot;] [org.apache.httpcomponents/httpclient &quot;4.4.1&quot;]] }}} ``` ### 2. Define the pacts between your consumers and providers You define all the providers and consumers within the `:pact` configuration element of your project. ```clojure :pact { :service-providers { ; You can define as many as you need, but each must have a unique name :provider1 { ; All the provider properties are optional, and have sensible defaults (shown below) :protocol &quot;http&quot; :host &quot;localhost&quot; :port 8080 :path &quot;/&quot; :has-pact-with { ; Again, you can define as many consumers for each provider as you need, but each must have a unique name :consumer1 { ; pact file can be either a path or an URL :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` ### 3. Execute `lein with-profile pact pact-verify` You will have to have your provider running for this to pass. ## Enabling insecure SSL For providers that are running on SSL with self-signed certificates, you need to enable insecure SSL mode by setting `:insecure true` on the provider. ```clojure :pact { :service-providers { :provider1 { :protocol &quot;https&quot; :host &quot;localhost&quot; :port 8443 :insecure true :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` ## Specifying a custom trust store For environments that are running their own certificate chains: ```clojure :pact { :service-providers { :provider1 { :protocol &quot;https&quot; :host &quot;localhost&quot; :port 8443 :trust-store &quot;relative/path/to/trustStore.jks&quot; :trust-store-password &quot;changeme&quot; :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` `:trust-store` is relative to the current working (build) directory. `:trust-store-password` defaults to `changeit`. NOTE: The hostname will still be verified against the certificate. ## Modifying the requests before they are sent Sometimes you may need to add things to the requests that can&apos;t be persisted in a pact file. Examples of these would be authentication tokens, which have a small life span. The Leiningen plugin provides a request filter that can be set to an anonymous function on the provider that will be called before the request is made. This function will receive the HttpRequest object as a parameter. ```clojure :pact { :service-providers { :provider1 { ; function that adds an Authorization header to each request :request-filter #(.addHeader % &quot;Authorization&quot; &quot;oauth-token eyJhbGciOiJSUzI1NiIsIm...&quot;) :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` __*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! ## Modifying the HTTP Client Used The default HTTP client is used for all requests to providers (created with a call to `HttpClients.createDefault()`). This can be changed by specifying a function assigned to `:create-client` on the provider that returns a `CloseableHttpClient`. The function will receive the provider info as a parameter. ## Turning off URL decoding of the paths in the pact file [version 3.3.3+] By default the paths loaded from the pact file will be decoded before the request is sent to the provider. To turn this behaviour off, set the system property `pact.verifier.disableUrlPathDecoding` to `true`. __*Important Note:*__ If you turn off the url path decoding, you need to ensure that the paths in the pact files are correctly encoded. The verifier will not be able to make a request with an invalid encoded path. ## Plugin Properties The following plugin options can be specified on the command line: |Property|Description| |--------|-----------| |:pact.showStacktrace|This turns on stacktrace printing for each request. It can help with diagnosing network errors| |:pact.showFullDiff|This turns on displaying the full diff of the expected versus actual bodies [version 3.3.6+]| |:pact.filter.consumers|Comma seperated list of consumer names to verify| |:pact.filter.description|Only verify interactions whose description match the provided regular expression| |:pact.filter.providerState|Only verify interactions whose provider state match the provided regular expression. An empty string matches interactions that have no state| |:pact.verifier.publishResults|Publishing of verification results will be skipped unless this property is set to &apos;true&apos; [version 3.5.18+]| |:pact.matching.wildcard|Enables matching of map values ignoring the keys when this property is set to &apos;true&apos;| Example, to run verification only for a particular consumer: ``` $ lein with-profile pact pact-verify :pact.filter.consumers=:consumer2 ``` ## Provider States For each provider you can specify a state change URL to use to switch the state of the provider. This URL will receive the `providerState` description from the pact file before each interaction via a POST. The `:state-change-uses-body` controls if the state is passed in the request body or as a query parameter. These values can be set at the provider level, or for a specific consumer. Consumer values take precedent if both are given. ```clojure :pact { :service-providers { :provider1 { :state-change-url &quot;http://localhost:8080/tasks/pactStateChange&quot; :state-change-uses-body false ; defaults to true :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` If the `:state-change-uses-body` is not specified, or is set to true, then the provider state description will be sent as JSON in the body of the request. If it is set to false, it will passed as a query parameter. As for normal requests (see Modifying the requests before they are sent), a state change request can be modified before it is sent. Set `:state-change-request-filter` to an anonymous function on the provider that will be called before the request is made. #### Returning values that can be injected (3.6.11+) You can have values from the provider state callbacks be injected into most places (paths, query parameters, headers, bodies, etc.). This works by using the V3 spec generators with provider state callbacks that return values. One example of where this would be useful is API calls that require an ID which would be auto-generated by the database on the provider side, so there is no way to know what the ID would be beforehand. There are methods on the consumer DSLs that can provider an expression that contains variables (like &apos;/api/user/${id}&apos; for the path). The provider state callback can then return a map for values, and the `id` attribute from the map will be expanded in the expression. For URL callbacks, the values need to be returned as JSON in the response body. ## Filtering the interactions that are verified You can filter the interactions that are run using three properties: `:pact.filter.consumers`, `:pact.filter.description` and `:pact.filter.providerState`. Adding `:pact.filter.consumers=:consumer1,:consumer2` to the command line will only run the pact files for those consumers (consumer1 and consumer2). Adding `:pact.filter.description=a request for payment.*` will only run those interactions whose descriptions start with &apos;a request for payment&apos;. `:pact.filter.providerState=.*payment` will match any interaction that has a provider state that ends with payment, and `:pact.filter.providerState=` will match any interaction that does not have a provider state. ## Starting and shutting down your provider For the pact verification to run, the provider needs to be running. Leiningen provides a `do` task that can chain tasks together. So, by creating a `start-app` and `terminate-app` alias, you could so something like: $ lein with-profile pact do start-app, pact-verify, terminate-app However, if the pact verification fails the build will abort without running the `terminate-app` task. To have the start and terminate tasks always run regardless of the state of the verification, you can assign them to `:start-provider-task` and `:terminate-provider-task` on the provider. ```clojure :aliases {&quot;start-app&quot; ^{:doc &quot;Starts the app&quot;} [&quot;tasks to start app ...&quot;] ; insert tasks to start the app here &quot;terminate-app&quot; ^{:doc &quot;Kills the app&quot;} [&quot;tasks to terminate app ...&quot;] ; insert tasks to stop the app here } :pact { :service-providers { :provider1 { :start-provider-task &quot;start-app&quot; :terminate-provider-task &quot;terminate-app&quot; :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` Then you can just run: $ lein with-profile pact pact-verify and the `start-app` and `terminate-app` tasks will run before and after the provider verification. ## Specifying the provider hostname at runtime [3.0.4+] If you need to calculate the provider hostname at runtime (for instance it is run as a new docker container or AWS instance), you can give an anonymous function as the provider host that returns the host name. The function will receive the provider information as a parameter. ```clojure :pact { :service-providers { :provider1 { :host #(calculate-host-name %) :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ```

Group: au.com.dius Artifact: pact-jvm-provider-lein_2.12
Show all versions Show documentation Show source 
 

0 downloads
Artifact pact-jvm-provider-lein_2.12
Group au.com.dius
Version 3.6.15
Last update 29. April 2020
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 8
Dependencies pact-jvm-provider_2.12, clojure, core.match, leiningen-core, logback-core, logback-classic, httpclient, jansi,
There are maybe transitive dependencies!

pact-jvm-provider-lein from group au.com.dius (version 4.0.10)

# Leiningen plugin to verify a provider Leiningen plugin for verifying pacts against a provider. The plugin provides a `pact-verify` task which will verify all configured pacts against your provider. ## To Use It ### 1. Add the plugin to your project plugins, preferably in it&apos;s own profile. ```clojure :profiles { :pact { :plugins [[au.com.dius/pact-jvm-provider-lein &quot;4.0.0&quot; :exclusions [commons-logging]]] :dependencies [[ch.qos.logback/logback-core &quot;1.1.3&quot;] [ch.qos.logback/logback-classic &quot;1.1.3&quot;] [org.apache.httpcomponents/httpclient &quot;4.4.1&quot;]] }}} ``` ### 2. Define the pacts between your consumers and providers You define all the providers and consumers within the `:pact` configuration element of your project. ```clojure :pact { :service-providers { ; You can define as many as you need, but each must have a unique name :provider1 { ; All the provider properties are optional, and have sensible defaults (shown below) :protocol &quot;http&quot; :host &quot;localhost&quot; :port 8080 :path &quot;/&quot; :has-pact-with { ; Again, you can define as many consumers for each provider as you need, but each must have a unique name :consumer1 { ; pact file can be either a path or an URL :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` ### 3. Execute `lein with-profile pact pact-verify` You will have to have your provider running for this to pass. ## Enabling insecure SSL For providers that are running on SSL with self-signed certificates, you need to enable insecure SSL mode by setting `:insecure true` on the provider. ```clojure :pact { :service-providers { :provider1 { :protocol &quot;https&quot; :host &quot;localhost&quot; :port 8443 :insecure true :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` ## Specifying a custom trust store For environments that are running their own certificate chains: ```clojure :pact { :service-providers { :provider1 { :protocol &quot;https&quot; :host &quot;localhost&quot; :port 8443 :trust-store &quot;relative/path/to/trustStore.jks&quot; :trust-store-password &quot;changeme&quot; :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` `:trust-store` is relative to the current working (build) directory. `:trust-store-password` defaults to `changeit`. NOTE: The hostname will still be verified against the certificate. ## Modifying the requests before they are sent Sometimes you may need to add things to the requests that can&apos;t be persisted in a pact file. Examples of these would be authentication tokens, which have a small life span. The Leiningen plugin provides a request filter that can be set to an anonymous function on the provider that will be called before the request is made. This function will receive the HttpRequest object as a parameter. ```clojure :pact { :service-providers { :provider1 { ; function that adds an Authorization header to each request :request-filter #(.addHeader % &quot;Authorization&quot; &quot;oauth-token eyJhbGciOiJSUzI1NiIsIm...&quot;) :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` __*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! ## Modifying the HTTP Client Used The default HTTP client is used for all requests to providers (created with a call to `HttpClients.createDefault()`). This can be changed by specifying a function assigned to `:create-client` on the provider that returns a `CloseableHttpClient`. The function will receive the provider info as a parameter. ## Turning off URL decoding of the paths in the pact file By default the paths loaded from the pact file will be decoded before the request is sent to the provider. To turn this behaviour off, set the system property `pact.verifier.disableUrlPathDecoding` to `true`. __*Important Note:*__ If you turn off the url path decoding, you need to ensure that the paths in the pact files are correctly encoded. The verifier will not be able to make a request with an invalid encoded path. ## Plugin Properties The following plugin options can be specified on the command line: |Property|Description| |--------|-----------| |:pact.showStacktrace|This turns on stacktrace printing for each request. It can help with diagnosing network errors| |:pact.showFullDiff|This turns on displaying the full diff of the expected versus actual bodies [version 3.3.6+]| |:pact.filter.consumers|Comma seperated list of consumer names to verify| |:pact.filter.description|Only verify interactions whose description match the provided regular expression| |:pact.filter.providerState|Only verify interactions whose provider state match the provided regular expression. An empty string matches interactions that have no state| |:pact.verifier.publishResults|Publishing of verification results will be skipped unless this property is set to &apos;true&apos; [version 3.5.18+]| |:pact.matching.wildcard|Enables matching of map values ignoring the keys when this property is set to &apos;true&apos;| Example, to run verification only for a particular consumer: ``` $ lein with-profile pact pact-verify :pact.filter.consumers=:consumer2 ``` ## Provider States For each provider you can specify a state change URL to use to switch the state of the provider. This URL will receive the `providerState` description from the pact file before each interaction via a POST. The `:state-change-uses-body` controls if the state is passed in the request body or as a query parameter. These values can be set at the provider level, or for a specific consumer. Consumer values take precedent if both are given. ```clojure :pact { :service-providers { :provider1 { :state-change-url &quot;http://localhost:8080/tasks/pactStateChange&quot; :state-change-uses-body false ; defaults to true :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` If the `:state-change-uses-body` is not specified, or is set to true, then the provider state description will be sent as JSON in the body of the request. If it is set to false, it will passed as a query parameter. As for normal requests (see Modifying the requests before they are sent), a state change request can be modified before it is sent. Set `:state-change-request-filter` to an anonymous function on the provider that will be called before the request is made. #### Returning values that can be injected (3.6.11+) You can have values from the provider state callbacks be injected into most places (paths, query parameters, headers, bodies, etc.). This works by using the V3 spec generators with provider state callbacks that return values. One example of where this would be useful is API calls that require an ID which would be auto-generated by the database on the provider side, so there is no way to know what the ID would be beforehand. There are methods on the consumer DSLs that can provider an expression that contains variables (like &apos;/api/user/${id}&apos; for the path). The provider state callback can then return a map for values, and the `id` attribute from the map will be expanded in the expression. For URL callbacks, the values need to be returned as JSON in the response body. ## Filtering the interactions that are verified You can filter the interactions that are run using three properties: `:pact.filter.consumers`, `:pact.filter.description` and `:pact.filter.providerState`. Adding `:pact.filter.consumers=:consumer1,:consumer2` to the command line will only run the pact files for those consumers (consumer1 and consumer2). Adding `:pact.filter.description=a request for payment.*` will only run those interactions whose descriptions start with &apos;a request for payment&apos;. `:pact.filter.providerState=.*payment` will match any interaction that has a provider state that ends with payment, and `:pact.filter.providerState=` will match any interaction that does not have a provider state. ## Starting and shutting down your provider For the pact verification to run, the provider needs to be running. Leiningen provides a `do` task that can chain tasks together. So, by creating a `start-app` and `terminate-app` alias, you could so something like: $ lein with-profile pact do start-app, pact-verify, terminate-app However, if the pact verification fails the build will abort without running the `terminate-app` task. To have the start and terminate tasks always run regardless of the state of the verification, you can assign them to `:start-provider-task` and `:terminate-provider-task` on the provider. ```clojure :aliases {&quot;start-app&quot; ^{:doc &quot;Starts the app&quot;} [&quot;tasks to start app ...&quot;] ; insert tasks to start the app here &quot;terminate-app&quot; ^{:doc &quot;Kills the app&quot;} [&quot;tasks to terminate app ...&quot;] ; insert tasks to stop the app here } :pact { :service-providers { :provider1 { :start-provider-task &quot;start-app&quot; :terminate-provider-task &quot;terminate-app&quot; :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` Then you can just run: $ lein with-profile pact pact-verify and the `start-app` and `terminate-app` tasks will run before and after the provider verification. ## Specifying the provider hostname at runtime If you need to calculate the provider hostname at runtime (for instance it is run as a new docker container or AWS instance), you can give an anonymous function as the provider host that returns the host name. The function will receive the provider information as a parameter. ```clojure :pact { :service-providers { :provider1 { :host #(calculate-host-name %) :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ```

Group: au.com.dius Artifact: pact-jvm-provider-lein
Show all versions Show documentation Show source 
 

0 downloads
Artifact pact-jvm-provider-lein
Group au.com.dius
Version 4.0.10
Last update 18. April 2020
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 10
Dependencies pact-jvm-provider, clojure, core.match, leiningen-core, maven-aether-provider, aether-connector-file, aether-connector-wagon, httpclient, jansi, groovy,
There are maybe transitive dependencies!

pact-jvm-provider-lein_2.11 from group au.com.dius (version 3.5.24)

# Leiningen plugin to verify a provider [version 2.2.14+, 3.0.3+] Leiningen plugin for verifying pacts against a provider. The plugin provides a `pact-verify` task which will verify all configured pacts against your provider. ## To Use It ### 1. Add the plugin to your project plugins, preferably in it&apos;s own profile. ```clojure :profiles { :pact { :plugins [[au.com.dius/pact-jvm-provider-lein_2.11 &quot;3.2.11&quot; :exclusions [commons-logging]]] :dependencies [[ch.qos.logback/logback-core &quot;1.1.3&quot;] [ch.qos.logback/logback-classic &quot;1.1.3&quot;] [org.apache.httpcomponents/httpclient &quot;4.4.1&quot;]] }}} ``` ### 2. Define the pacts between your consumers and providers You define all the providers and consumers within the `:pact` configuration element of your project. ```clojure :pact { :service-providers { ; You can define as many as you need, but each must have a unique name :provider1 { ; All the provider properties are optional, and have sensible defaults (shown below) :protocol &quot;http&quot; :host &quot;localhost&quot; :port 8080 :path &quot;/&quot; :has-pact-with { ; Again, you can define as many consumers for each provider as you need, but each must have a unique name :consumer1 { ; pact file can be either a path or an URL :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` ### 3. Execute `lein with-profile pact pact-verify` You will have to have your provider running for this to pass. ## Enabling insecure SSL For providers that are running on SSL with self-signed certificates, you need to enable insecure SSL mode by setting `:insecure true` on the provider. ```clojure :pact { :service-providers { :provider1 { :protocol &quot;https&quot; :host &quot;localhost&quot; :port 8443 :insecure true :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` ## Specifying a custom trust store For environments that are running their own certificate chains: ```clojure :pact { :service-providers { :provider1 { :protocol &quot;https&quot; :host &quot;localhost&quot; :port 8443 :trust-store &quot;relative/path/to/trustStore.jks&quot; :trust-store-password &quot;changeme&quot; :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` `:trust-store` is relative to the current working (build) directory. `:trust-store-password` defaults to `changeit`. NOTE: The hostname will still be verified against the certificate. ## Modifying the requests before they are sent Sometimes you may need to add things to the requests that can&apos;t be persisted in a pact file. Examples of these would be authentication tokens, which have a small life span. The Leiningen plugin provides a request filter that can be set to an anonymous function on the provider that will be called before the request is made. This function will receive the HttpRequest object as a parameter. ```clojure :pact { :service-providers { :provider1 { ; function that adds an Authorization header to each request :request-filter #(.addHeader % &quot;Authorization&quot; &quot;oauth-token eyJhbGciOiJSUzI1NiIsIm...&quot;) :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` __*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! ## Modifying the HTTP Client Used The default HTTP client is used for all requests to providers (created with a call to `HttpClients.createDefault()`). This can be changed by specifying a function assigned to `:create-client` on the provider that returns a `CloseableHttpClient`. The function will receive the provider info as a parameter. ## Turning off URL decoding of the paths in the pact file [version 3.3.3+] By default the paths loaded from the pact file will be decoded before the request is sent to the provider. To turn this behaviour off, set the system property `pact.verifier.disableUrlPathDecoding` to `true`. __*Important Note:*__ If you turn off the url path decoding, you need to ensure that the paths in the pact files are correctly encoded. The verifier will not be able to make a request with an invalid encoded path. ## Plugin Properties The following plugin options can be specified on the command line: |Property|Description| |--------|-----------| |:pact.showStacktrace|This turns on stacktrace printing for each request. It can help with diagnosing network errors| |:pact.showFullDiff|This turns on displaying the full diff of the expected versus actual bodies [version 3.3.6+]| |:pact.filter.consumers|Comma seperated list of consumer names to verify| |:pact.filter.description|Only verify interactions whose description match the provided regular expression| |:pact.filter.providerState|Only verify interactions whose provider state match the provided regular expression. An empty string matches interactions that have no state| |:pact.verifier.publishResults|Publishing of verification results will be skipped unless this property is set to &apos;true&apos; [version 3.5.18+]| |:pact.matching.wildcard|Enables matching of map values ignoring the keys when this property is set to &apos;true&apos;| Example, to run verification only for a particular consumer: ``` $ lein with-profile pact pact-verify :pact.filter.consumers=consumer2 ``` ## Provider States For each provider you can specify a state change URL to use to switch the state of the provider. This URL will receive the `providerState` description from the pact file before each interaction via a POST. The `:state-change-uses-body` controls if the state is passed in the request body or as a query parameter. These values can be set at the provider level, or for a specific consumer. Consumer values take precedent if both are given. ```clojure :pact { :service-providers { :provider1 { :state-change-url &quot;http://localhost:8080/tasks/pactStateChange&quot; :state-change-uses-body false ; defaults to true :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` If the `:state-change-uses-body` is not specified, or is set to true, then the provider state description will be sent as JSON in the body of the request. If it is set to false, it will passed as a query parameter. As for normal requests (see Modifying the requests before they are sent), a state change request can be modified before it is sent. Set `:state-change-request-filter` to an anonymous function on the provider that will be called before the request is made. ## Filtering the interactions that are verified You can filter the interactions that are run using three properties: `:pact.filter.consumers`, `:pact.filter.description` and `:pact.filter.providerState`. Adding `:pact.filter.consumers=consumer1,consumer2` to the command line will only run the pact files for those consumers (consumer1 and consumer2). Adding `:pact.filter.description=a request for payment.*` will only run those interactions whose descriptions start with &apos;a request for payment&apos;. `:pact.filter.providerState=.*payment` will match any interaction that has a provider state that ends with payment, and `:pact.filter.providerState=` will match any interaction that does not have a provider state. ## Starting and shutting down your provider For the pact verification to run, the provider needs to be running. Leiningen provides a `do` task that can chain tasks together. So, by creating a `start-app` and `terminate-app` alias, you could so something like: $ lein with-profile pact do start-app, pact-verify, terminate-app However, if the pact verification fails the build will abort without running the `terminate-app` task. To have the start and terminate tasks always run regardless of the state of the verification, you can assign them to `:start-provider-task` and `:terminate-provider-task` on the provider. ```clojure :aliases {&quot;start-app&quot; ^{:doc &quot;Starts the app&quot;} [&quot;tasks to start app ...&quot;] ; insert tasks to start the app here &quot;terminate-app&quot; ^{:doc &quot;Kills the app&quot;} [&quot;tasks to terminate app ...&quot;] ; insert tasks to stop the app here } :pact { :service-providers { :provider1 { :start-provider-task &quot;start-app&quot; :terminate-provider-task &quot;terminate-app&quot; :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ``` Then you can just run: $ lein with-profile pact pact-verify and the `start-app` and `terminate-app` tasks will run before and after the provider verification. ## Specifying the provider hostname at runtime [3.0.4+] If you need to calculate the provider hostname at runtime (for instance it is run as a new docker container or AWS instance), you can give an anonymous function as the provider host that returns the host name. The function will receive the provider information as a parameter. ```clojure :pact { :service-providers { :provider1 { :host #(calculate-host-name %) :has-pact-with { :consumer1 { :pact-file &quot;path/to/provider1-consumer1-pact.json&quot; } } } } } ```

Group: au.com.dius Artifact: pact-jvm-provider-lein_2.11
Show all versions Show documentation Show source 
 

0 downloads
Artifact pact-jvm-provider-lein_2.11
Group au.com.dius
Version 3.5.24
Last update 04. November 2018
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 15
Dependencies kotlin-stdlib-jdk8, kotlin-reflect, slf4j-api, groovy-all, kotlin-logging, scala-library, scala-logging_2.11, pact-jvm-provider_2.11, clojure, core.match, leiningen-core, logback-core, logback-classic, httpclient, jansi,
There are maybe transitive dependencies!



Page 82 from 85 (items total 845)


© 2015 - 2024 Weber Informatics LLC | Privacy Policy