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

Download JAR files tagged by environment with all dependencies

Search JAR files by class name

gwt-reflect from group net.wetheinter (version 2.5.1)

Group: net.wetheinter Artifact: gwt-reflect
Show documentation Show source 
 

3 downloads
Artifact gwt-reflect
Group net.wetheinter
Version 2.5.1
Last update 23. February 2014
Organization not specified
URL Not specified
License not specified
Dependencies amount 2
Dependencies xapi-dev-source, gwt-method-inject,
There are maybe transitive dependencies!

gwt-method-inject from group net.wetheinter (version 2.5.1)

Group: net.wetheinter Artifact: gwt-method-inject
Show documentation Show source 
 

0 downloads
Artifact gwt-method-inject
Group net.wetheinter
Version 2.5.1
Last update 23. February 2014
Organization not specified
URL Not specified
License not specified
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!

commons-crypto from group org.apache.commons (version 1.2.0)

Apache Commons Crypto is a cryptographic library optimized with AES-NI (Advanced Encryption Standard New Instructions). It provides Java API for both cipher level and Java stream level. Developers can use it to implement high performance AES encryption/decryption with the minimum code and effort. Please note that Crypto doesn't implement the cryptographic algorithm such as AES directly. It wraps to OpenSSL or JCE which implement the algorithms. Features -------- 1. Cipher API for low level cryptographic operations. 2. Java stream API (CryptoInputStream/CryptoOutputStream) for high level stream encryption/decryption. 3. Both optimized with high performance AES encryption/decryption. (1400 MB/s - 1700 MB/s throughput in modern Xeon processors). 4. JNI-based implementation to achieve comparable performance to the native C/C++ version based on OpenSsl. 5. Portable across various operating systems (currently only Linux/MacOSX/Windows); Apache Commons Crypto loads the library according to your machine environment (it checks system properties, `os.name` and `os.arch`). 6. Simple usage. Add the commons-crypto-(version).jar file to your classpath. Export restrictions ------------------- This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See <http://www.wassenaar.org/> for more information. The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code. The following provides more details on the included cryptographic software: * Commons Crypto use [Java Cryptography Extension](http://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html) provided by Java * Commons Crypto link to and use [OpenSSL](https://www.openssl.org/) ciphers

Group: org.apache.commons Artifact: commons-crypto
Show all versions Show documentation Show source 
 

74 downloads
Artifact commons-crypto
Group org.apache.commons
Version 1.2.0
Last update 14. January 2023
Organization not specified
URL https://commons.apache.org/proper/commons-crypto/
License Apache License, Version 2.0
Dependencies amount 1
Dependencies jna,
There are maybe transitive dependencies!

specs2_2.13 from group au.com.dius.pact.consumer (version 4.2.21)

pact-jvm-consumer-specs2 ======================== ## Specs2 Bindings for the pact-jvm library ## Dependency In the root folder of your project in build.sbt add the line: ```scala libraryDependencies += &quot;au.com.dius.pact.consumer&quot; %% &quot;specs2&quot; % &quot;4.0.1&quot; ``` or if you are using Gradle: ```groovy dependencies { testCompile &quot;au.com.dius.pact.consumer:specs2_2.13:4.0.1&quot; } ``` __*Note:*__ `PactSpec` requires spec2 3.x. Also, for spray users there&apos;s an incompatibility between specs2 v3.x and spray. Follow these instructions to resolve that problem: https://groups.google.com/forum/#!msg/spray-user/2T6SBp4OJeI/AJlnJuAKPRsJ ## Usage To author a test, mix `PactSpec` into your spec First we define a service client called `ConsumerService`. In our example this is a simple wrapper for `dispatch`, an HTTP client. The source code can be found in the test folder alongside the `ExamplePactSpec`. Here is a simple example: ``` import au.com.dius.pact.consumer.PactSpec class ExamplePactSpec extends Specification with PactSpec { val consumer = &quot;My Consumer&quot; val provider = &quot;My Provider&quot; override def is = uponReceiving(&quot;a request for foo&quot;) .matching(path = &quot;/foo&quot;) .willRespondWith(body = &quot;{}&quot;) .withConsumerTest { providerConfig =&gt; Await.result(ConsumerService(providerConfig.url).simpleGet(&quot;/foo&quot;), Duration(1000, MILLISECONDS)) must beEqualTo(200, Some(&quot;{}&quot;)) } } ``` This spec will be run along with the rest of your specs2 unit tests and will output your pact json to ``` /target/pacts/&lt;Consumer&gt;_&lt;Provider&gt;.json ``` # Forcing pact files to be overwritten (3.6.5+) By default, when the pact file is written, it will be merged with any existing pact file. To force the file to be overwritten, set the Java system property `pact.writer.overwrite` to `true`. # Test Analytics We are tracking anonymous analytics to gather important usage statistics like JVM version and operating system. To disable tracking, set the &apos;pact_do_not_track&apos; system property or environment variable to &apos;true&apos;.

Group: au.com.dius.pact.consumer Artifact: specs2_2.13
Show all versions Show documentation Show source 
 

0 downloads
Artifact specs2_2.13
Group au.com.dius.pact.consumer
Version 4.2.21
Last update 13. May 2022
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 5
Dependencies consumer, json, specs2-core_2.13, async-http-client, scala-java8-compat_2.13,
There are maybe transitive dependencies!

osgi-tests from group org.apache.axis2 (version 1.6.3)

Group: org.apache.axis2 Artifact: osgi-tests
Show source 
 

1 downloads
Artifact osgi-tests
Group org.apache.axis2
Version 1.6.3
Last update 27. June 2015
Organization not specified
URL http://axis.apache.org/axis2/java/core/
License not specified
Dependencies amount 1
Dependencies axis2-testutils,
There are maybe transitive dependencies!

axis2-parent from group org.apache.axis2 (version 1.6.3)

Axis2 is an effort to re-design and totally re-implement both Axis/Java and (eventually) Axis/C++ on a new architecture. Evolving from the now standard "handler chain" model which Axis1 pioneered, Axis2 is developing a more flexible pipeline architecture which can yet be managed and packaged in a more organized manner. This new design acknowledges the maturing of the Web services space in terms of new protocols such as WS-ReliableMessaging, WS-Security and WS-Addressing that are built on top of the base SOAP system. At the time Axis1 was designed, while it was fully expected that other protocols such as WS-ReliableMessaging would be built on top of it, there was not a proper extension architecture defined to enable clean composition of such layers. Thus, one of the key motivations for Axis2 is to provide a clean and simple environment for like Apache Sandesha and Apache WSS4J to layer on top of the base SOAP system. Another driving force for Axis2 as well as the move away from RPC oriented Web services towards more document-oriented, message style asynchronous service interactions. The Axis2 project is centered on a new representation for SOAP messages called AXIOM (AXIs Object Model). AXIOM consists of two parts: a complete XML Infoset representation and a SOAP Infoset representation on top of that. The XML Infoset representation provides a JDOM-like simple API but is built on a deferred model via a StAX-based (Streaming API for XML) pull parsing API. A key feature of AXIOM is that it allows one to stop building the XML tree and just access the pull stream directly; thus enabling both maximum flexibility and maximum performance. This approach allows us to support multiple levels of abstraction for consuming and offering Web services: using plain AXIOM, using generated code and statically data-bound data types and so on. At the time of Axis1's design, RPC-style, synchronous, request-response interactions were the order of the day for Web services. Today service interactions are much more message -oriented and exploit many different message exchange patterns. The Axis2 engine architecture is careful to not build in any assumptions of request-response patterns to ensure that it can be used easily to support arbitrary message exchange patterns.

Group: org.apache.axis2 Artifact: axis2-parent
Show all versions 
There is no JAR file uploaded. A download is not possible! Please choose another version.
0 downloads
Artifact axis2-parent
Group org.apache.axis2
Version 1.6.3
Last update 27. June 2015
Organization not specified
URL http://axis.apache.org/axis2/java/core/
License not specified
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!

xapi-gwt-parent from group net.wetheinter (version 0.5)

This is the main aggregator for all gwt submodules. All gwt-specific code resides here. Submodules should avoid inheriting from each other unless necessary. This goes for maven structure and gwt.xml structure. The super module is where our jre emulation layer and super-source live; all modules should inherit super, and a minimum of other modules. Some modules, like injection, are fulfilling an api in the core module, and should be accessed only through core service interfaces. Other modules, like reflection, are capable of being standalone inherits, but can benefit from core utilities like injection, so, two (or more) .gwt.xml modules may be provided. As XApi nears 1.0, all submodules will be routinely stitched together into an uber-jar, in order to have a single jar with a single gwt module that can provide all of the services at once. Internal projects will never use the uber jar, to help maintain modularity, but external projects that want to use more than one service will certainly prefer inheriting one artifact, instead of twelve. When distributed in uber-jar format, it will likely be necessary for either the uber jar, or just xapi-gwt-api.jar to appear before gwt-dev on your compile-time classpath. If using gwt-maven-plugin, the gwtFirstOnClasspath option may become problematic. If so, we will provide a forked gwt-plugin to make sure our compiler enhancements are included in the build process. There is also work going on to make a super-source-everything plugin, which will use maven to find source files, and generate synthetic .gwt.xml for you, as part of an effort to create a wholly unified programming environment. In addition to java-to-javascript, we intend to compile java-to-java and possibly other languages, like go; imagine implementing gwt deferred binding to eliminate cross-platform differences between server environments, or operating systems, or versions of a platform, or anywhere else a core api needs to bind to multiple implementations, depending on the runtime environment.

Group: net.wetheinter Artifact: xapi-gwt-parent
Show all versions 
There is no JAR file uploaded. A download is not possible! Please choose another version.
0 downloads
Artifact xapi-gwt-parent
Group net.wetheinter
Version 0.5
Last update 30. May 2015
Organization not specified
URL WeTheInter.net
License not specified
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!

java8 from group au.com.dius.pact.consumer (version 4.1.42)

# pact-jvm-consumer-java8 Provides a Java8 lambda based DSL for use with Junit to build consumer tests. ## Dependency The library is available on maven central using: * group-id = `au.com.dius.pact.consumer` * artifact-id = `java8` * version-id = `4.1.x` # A Lambda DSL for Pact This is an extension for the pact DSL provided by [consumer](../consumer). The difference between the default pact DSL and this lambda DSL is, as the name suggests, the usage of lambdas. The use of lambdas makes the code much cleaner. ## Why a new DSL implementation? The lambda DSL solves the following two main issues. Both are visible in the following code sample: ```java new PactDslJsonArray() .array() # open an array .stringValue(&quot;a1&quot;) # choose the method that is valid for arrays .stringValue(&quot;a2&quot;) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .numberValue(1) # choose the method that is valid for arrays .numberValue(2) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .object() # now we work with an object .stringValue(&quot;foo&quot;, &quot;Foo&quot;) # choose the method that is valid for objects .closeObject() # close the object and we&apos;re back in the array .closeArray() # close the array ``` ### The existing DSL is quite error-prone Methods may only be called in certain states. For example `object()` may only be called when you&apos;re currently working on an array whereas `object(name)` is only allowed to be called when working on an object. But both of the methods are available. You&apos;ll find out at runtime if you&apos;re using the correct method. Finally, the need for opening and closing objects and arrays makes usage cumbersome. The lambda DSL has no ambiguous methods and there&apos;s no need to close objects and arrays as all the work on such an object is wrapped in a lamda call. ### The existing DSL is hard to read When formatting your source code with an IDE the code becomes hard to read as there&apos;s no indentation possible. Of course, you could do it by hand but we want auto formatting! Auto formatting works great for the new DSL! ```java array.object((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); # an attribute o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); # an attribute o.object(&quot;tar&quot;, (tarObject) -&gt; { # an attribute with a nested object tarObject.stringValue(&quot;a&quot;, &quot;A&quot;); # attribute of the nested object tarObject.stringValue(&quot;b&quot;, &quot;B&quot;); # attribute of the nested object }) }); ``` ## Installation ### Maven ``` &lt;dependency&gt; &lt;groupId&gt;au.com.dius.pact.consumer&lt;/groupId&gt; &lt;artifactId&gt;java8&lt;/artifactId&gt; &lt;version&gt;${pact.version}&lt;/version&gt; &lt;/dependency&gt; ``` ## Usage Start with a static import of `LambdaDsl`. This class contains factory methods for the lambda dsl extension. When you come accross the `body()` method of `PactDslWithProvider` builder start using the new extensions. The call to `LambdaDsl` replaces the call to instance `new PactDslJsonArray()` and `new PactDslJsonBody()` of the pact library. ```java io.pactfoundation.consumer.dsl.LambdaDsl.* ``` ### Response body as json array ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonArray; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonArray((a) -&gt; { a.stringValue(&quot;a1&quot;); a.stringValue(&quot;a2&quot;); }).build()); ``` ### Response body as json object ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build()); ``` ### Examples #### Simple Json object When creating simple json structures the difference between the two approaches isn&apos;t big. ##### JSON ```json { &quot;bar&quot;: &quot;Bar&quot;, &quot;foo&quot;: &quot;Foo&quot; } ``` ##### Pact DSL ```java new PactDslJsonBody() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .stringValue(&quot;bar&quot;, &quot;Bar&quot;) ``` ##### Lambda DSL ```java newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build(); ``` #### An array of arrays When we come to more complex constructs with arrays and nested objects the beauty of lambdas become visible! ##### JSON ```json [ [&quot;a1&quot;, &quot;a2&quot;], [1, 2], [{&quot;foo&quot;: &quot;Foo&quot;}] ] ``` ##### Pact DSL ```java new PactDslJsonArray() .array() .stringValue(&quot;a1&quot;) .stringValue(&quot;a2&quot;) .closeArray() .array() .numberValue(1) .numberValue(2) .closeArray() .array() .object() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .closeObject() .closeArray(); ``` ##### Lambda DSL ```java newJsonArray((rootArray) -&gt; { rootArray.array((a) -&gt; a.stringValue(&quot;a1&quot;).stringValue(&quot;a2&quot;)); rootArray.array((a) -&gt; a.numberValue(1).numberValue(2)); rootArray.array((a) -&gt; a.object((o) -&gt; o.stringValue(&quot;foo&quot;, &quot;Foo&quot;))); }).build(); ``` ##### Kotlin Lambda DSL ```kotlin newJsonArray { newArray { stringValue(&quot;a1&quot;) stringValue(&quot;a2&quot;) } newArray { numberValue(1) numberValue(2) } newArray { newObject { stringValue(&quot;foo&quot;, &quot;Foo&quot;) } } } ``` # Test Analytics We are tracking anonymous analytics to gather important usage statistics like JVM version and operating system. To disable tracking, set the &apos;pact_do_not_track&apos; system property or environment variable to &apos;true&apos;.

Group: au.com.dius.pact.consumer Artifact: java8
Show all versions Show documentation Show source 
 

0 downloads
Artifact java8
Group au.com.dius.pact.consumer
Version 4.1.42
Last update 28. July 2023
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 1
Dependencies consumer,
There are maybe transitive dependencies!

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

# Pact junit runner ## Overview Library provides ability to play contract tests against a provider service in JUnit fashionable way. Supports: - Out-of-the-box convenient ways to load pacts - Easy way to change assertion strategy - **org.junit.BeforeClass**, **org.junit.AfterClass** and **org.junit.ClassRule** JUnit annotations, that will be run once - before/after whole contract test suite. - **org.junit.Before**, **org.junit.After** and **org.junit.Rule** JUnit annotations, that will be run before/after each test of an interaction. - **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. These methods must either take no parameters or a single Map parameter. ## Example of HTTP test ```java @RunWith(PactRunner.class) // Say JUnit to run tests with custom Runner @Provider(&quot;myAwesomeService&quot;) // Set up name of tested provider @PactFolder(&quot;pacts&quot;) // Point where to find pacts (See also section Pacts source in documentation) public class ContractTest { // NOTE: this is just an example of embedded service that listens to requests, you should start here real service @ClassRule //Rule will be applied once: before/after whole contract test suite public static final ClientDriverRule embeddedService = new ClientDriverRule(8332); @BeforeClass //Method will be run once: before whole contract test suite public static void setUpService() { //Run DB, create schema //Run service //... } @Before //Method will be run before each test of interaction public void before() { // Rest data // Mock dependent service responses // ... embeddedService.addExpectation( onRequestTo(&quot;/data&quot;), giveEmptyResponse() ); } @State(&quot;default&quot;, &quot;no-data&quot;) // Method will be run before testing interactions that require &quot;default&quot; or &quot;no-data&quot; state public void toDefaultState() { // Prepare service before interaction that require &quot;default&quot; state // ... System.out.println(&quot;Now service in default state&quot;); } @State(&quot;with-data&quot;) // Method will be run before testing interactions that require &quot;with-data&quot; state public void toStateWithData(Map data) { // Prepare service before interaction that require &quot;with-data&quot; state. The provider state data will be passed // in the data parameter // ... System.out.println(&quot;Now service in state using data &quot; + data); } @TestTarget // Annotation denotes Target that will be used for tests public final Target target = new HttpTarget(8332); // Out-of-the-box implementation of Target (for more information take a look at Test Target section) } ``` ## Example of AMQP Message test ```java @RunWith(PactRunner.class) // Say JUnit to run tests with custom Runner @Provider(&quot;myAwesomeService&quot;) // Set up name of tested provider @PactBroker(host=&quot;pactbroker&quot;, port = &quot;80&quot;) public class ConfirmationKafkaContractTest { @TestTarget // Annotation denotes Target that will be used for tests public final Target target = new AmqpTarget(); // Out-of-the-box implementation of Target (for more information take a look at Test Target section) @BeforeClass //Method will be run once: before whole contract test suite public static void setUpService() { //Run DB, create schema //Run service //... } @Before //Method will be run before each test of interaction public void before() { // Message data preparation // ... } @PactVerifyProvider(&apos;an order confirmation message&apos;) String verifyMessageForOrder() { Order order = new Order() order.setId(10000004) order.setPrice(BigDecimal.TEN) order.setUnits(15) def message = new ConfirmationKafkaMessageBuilder() .withOrder(order) .build() JsonOutput.toJson(message) } } ``` ## Provider state callback methods For the provider states in the pact being verified, you can define methods to be invoked to setup the correct state for each interaction. Just annotate a method with the `au.com.dius.pact.provider.junit.State` annotation and the method will be invoked before the interaction is verified. For example: ```java @State(&quot;SomeProviderState&quot;) // Must match the state description in the pact file public void someProviderState() { // Do what you need to set the correct state } ``` If there are parameters in the pact file, just add a Map parameter to the method to be able to access those parameters. ```java @State(&quot;SomeProviderState&quot;) public void someProviderState(Map&lt;String, Object&gt; providerStateParameters) { // Do what you need to set the correct state } ``` ### Provider state teardown methods [3.5.22+] If you need to tear down your provider state, you can annotate a method with the `@State` annotation with the action set to `StateChangeAction.TEARDOWN` and it will be invoked after the interaction is verified. ```java @State(&quot;SomeProviderState&quot;, action = StateChangeAction.TEARDOWN) public void someProviderStateCleanup() { // Do what you need to to teardown the state } ``` ## Pact source The Pact runner will automatically collect pacts based on annotations on the test class. For this purpose there are 3 out-of-the-box options (files from a directory, files from a set of URLs or a pact broker) or you can easily add your own Pact source. If you need to load a single pact file from the file system, use the `PactUrl` with the URL set to the file path. **Note:** You can only define one source of pacts per test class. ### Download pacts from a pact-broker To use pacts from a Pact Broker, annotate the test class with `@PactBroker(host=&quot;host.of.pact.broker.com&quot;, port = &quot;80&quot;)`. From _version 3.2.2/2.4.3+_ you can also specify the protocol, which defaults to &quot;http&quot;. The pact broker will be queried for all pacts with the same name as the provider annotation. For example, test all pacts for the &quot;Activity Service&quot; in the pact broker: ```java @RunWith(PactRunner.class) @Provider(&quot;Activity Service&quot;) @PactBroker(host = &quot;localhost&quot;, port = &quot;80&quot;) public class PactJUnitTest { @TestTarget public final Target target = new HttpTarget(5050); } ``` #### _Version 3.2.3/2.4.4+_ - Using Java System properties The pact broker loader was updated to allow system properties to be used for the hostname, port or protocol. The port was changed to a string to allow expressions to be set. To use a system property or environment variable, you can place the property name in `${}` expression de-markers: ```java @PactBroker(host=&quot;${pactbroker.hostname}&quot;, port = &quot;80&quot;) ``` You can provide a default value by separating the property name with a colon (`:`): ```java @PactBroker(host=&quot;${pactbroker.hostname:localhost}&quot;, port = &quot;80&quot;) ``` #### _Version 3.5.3+_ - More Java System properties The default values of the `@PactBroker` annotation now enable variable interpolation. The following keys may be managed through the environment * `pactbroker.host` * `pactbroker.port` * `pactbroker.protocol` * `pactbroker.tags` (comma separated) * `pactbroker.auth.scheme` * `pactbroker.auth.username` * `pactbroker.auth.password` #### _Version 3.2.4/2.4.6+_ - Using tags with the pact broker The pact broker allows different versions to be tagged. To load all the pacts: ```java @PactBroker(host=&quot;pactbroker&quot;, port = &quot;80&quot;, tags = {&quot;latest&quot;, &quot;dev&quot;, &quot;prod&quot;}) ``` The default value for tags is `latest` which is not actually a tag but instead corresponds to the latest version ignoring the tags. If there are multiple consumers matching the name specified in the provider annotation then the latest pact for each of the consumers is loaded. For any other value the latest pact tagged with the specified tag is loaded. Specifying multiple tags is an OR operation. For example if you specify `tags = {&quot;dev&quot;, &quot;prod&quot;}` then both the latest pact file tagged with `dev` and the latest pact file taggged with `prod` is loaded. #### _Version 3.3.4/2.4.19+_ - Using basic auth with the with the pact broker You can use basic authentication with the `@PactBroker` annotation by setting the `authentication` value to a `@PactBrokerAuth` annotation. For example: ```java @PactBroker(host = &quot;${pactbroker.url:localhost}&quot;, port = &quot;1234&quot;, tags = {&quot;latest&quot;, &quot;prod&quot;, &quot;dev&quot;}, authentication = @PactBrokerAuth(username = &quot;test&quot;, password = &quot;test&quot;)) ``` The `username` and `password` values also take Java system property expressions. ### Pact Url To use pacts from urls annotate the test class with ```java @PactUrl(urls = {&quot;http://build.server/zoo_app-animal_service.json&quot;} ) ``` If you need to load a single pact file from the file system, you can use the `PactUrl` with the URL set to the file path. ### Pact folder To use pacts from a resource folder of the project annotate test class with ```java @PactFolder(&quot;subfolder/in/resource/directory&quot;) ``` ### Custom pacts source It&apos;s possible to use a custom Pact source. For this, implement interface `au.com.dius.pact.provider.junit.loader.PactLoader` and annotate the test class with `@PactSource(MyOwnPactLoader.class)`. **Note:** class `MyOwnPactLoader` must have a default empty constructor or a constructor with one argument of class `Class` which at runtime will be the test class so you can get custom annotations of test class. ### Filtering the interactions that are verified [version 3.5.3+] By default, the pact runner will verify all pacts for the given provider. You can filter the pacts and interactions by the following methods. #### Filtering by Consumer You can run only those pacts for a particular consumer by adding a `@Consumer` annotation to the test class. For example: ```java @RunWith(PactRunner.class) @Provider(&quot;Activity Service&quot;) @Consumer(&quot;Activity Consumer&quot;) @PactBroker(host = &quot;localhost&quot;, port = &quot;80&quot;) public class PactJUnitTest { @TestTarget public final Target target = new HttpTarget(5050); } ``` #### Filtering by Provider State You can filter the interactions that are executed by adding a `@PactFilter` annotation to your test class. The pact filter annotation will then only verify interactions that have a matching provider state. You can provide multiple states to match with. For example: ```java @RunWith(PactRunner.class) @Provider(&quot;Activity Service&quot;) @PactBroker(host = &quot;localhost&quot;, port = &quot;80&quot;) @PactFilter(&apos;Activity 100 exists in the database&apos;) public class PactJUnitTest { @TestTarget public final Target target = new HttpTarget(5050); } ``` You can also use regular expressions with the filter [version 3.5.3+]. For example: ```java @RunWith(PactRunner.class) @PactFilter(&apos;Activity \\d+ exists in the database&apos;) public class PactJUnitTest { } ``` ### Setting the test to not fail when no pacts are found [version 3.5.3+] By default the pact runner will fail the verification test if no pact files are found to verify. To change the failure into a warning, add a `@IgnoreNoPactsToVerify` annotation to your test class. #### Ignoring IO errors loading pact files [version 3.5.24+] You can also set the test to ignore any IO and parser exceptions when loading the pact files by setting the `ignoreIoErrors` attribute on the annotation to `&quot;true&quot;` or setting the JVM system property `pact.verification.ignoreIoErrors` to `true`. ** WARNING! Do not enable this on your CI server, as this could result in your build passing with no providers having been verified due to a configuration error. ** ## Test target The field in test class of type `au.com.dius.pact.provider.junit.target.Target` annotated with `au.com.dius.pact.provider.junit.target.TestTarget` will be used for actual Interaction execution and asserting of contract. **Note:** there must be exactly 1 such field, otherwise an `InitializationException` will be thrown. ### HttpTarget `au.com.dius.pact.provider.junit.target.HttpTarget` - out-of-the-box implementation of `au.com.dius.pact.provider.junit.target.Target` that will play pacts as http request and assert response from service by matching rules from pact. _Version 3.2.2/2.4.3+_ you can also specify the protocol, defaults to &quot;http&quot;. ### AmqpTarget `au.com.dius.pact.provider.junit.target.AmqpTarget` - out-of-the-box implementation of `au.com.dius.pact.provider.junit.target.Target` that will play pacts as an AMQP message and assert response from service by matching rules from pact. #### Modifying the requests before they are sent [Version 3.2.3/2.4.5+] 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 HttpTarget supports request filters by annotating methods on the test class with `@TargetRequestFilter`. These methods must be public void methods that take a single HttpRequest parameter. For example: ```java @TargetRequestFilter public void exampleRequestFilter(HttpRequest request) { request.addHeader(&quot;Authorization&quot;, &quot;OAUTH hdsagasjhgdjashgdah...&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! #### 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. ### Custom Test Target It&apos;s possible to use custom `Target`, for that interface `Target` should be implemented and this class can be used instead of `HttpTarget`. # Verification Reports [versions 3.2.7/2.4.9+] The default test behaviour is to display the verification being done to the console, and pass or fail the test via the normal JUnit mechanism. From versions 3.2.7/2.4.9+, additional reports can be generated from the tests. ## Enabling additional reports via annotations on the test classes A `@VerificationReports` annotation can be added to any pact test class which will control the verification output. The annotation takes a list report types and an optional report directory (defaults to &quot;target/pact/reports&quot;). The currently supported report types are `console`, `markdown` and `json`. For example: ```java @VerificationReports({&quot;console&quot;, &quot;markdown&quot;}) public class MyPactTest { ``` will enable the markdown report in addition to the normal console output. And, ```java @VerificationReports(value = {&quot;markdown&quot;}, reportDir = &quot;/myreports&quot;) public class MyPactTest { ``` will disable the normal console output and write the markdown reports to &quot;/myreports&quot;. ## Enabling additional reports via Java system properties or environment variables The additional reports can also be enabled with Java System properties or environment variables. The following two properties have been introduced: `pact.verification.reports` and `pact.verification.reportDir`. `pact.verification.reports` is the comma separated list of report types to enable (e.g. `console,json,markdown`). `pact.verification.reportDir` is the directory to write reports to (defaults to &quot;target/pact/reports&quot;). ## Additional Reports The following report types are available in addition to console output (`console`, which is enabled by default): `markdown`, `json`. You can also provide a fully qualified classname as report so custom reports are also supported. This class must implement `au.com.dius.pact.provider.reporters.VerifierReporter` interface in order to be correct custom implementation of a report. # Publishing verification results to a Pact Broker [version 3.5.4+] For pacts that are loaded from a Pact Broker, the results of running the verification can be published back to the broker against the URL for the pact. You will be able to see the result on the Pact Broker home screen. You need to set the version of the provider that is verified using the `pact.provider.version` system property. To enable publishing of results, set the property `pact.verifier.publishResults` to `true` [version 3.5.18+].

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

9 downloads
Artifact pact-jvm-provider-junit_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, fluent-hc, httpclient, junit, commons-lang3, jool, guava-retrying, mail,
There are maybe transitive dependencies!

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

# Pact junit runner ## Overview Library provides ability to play contract tests against a provider service in JUnit fashionable way. Supports: - Out-of-the-box convenient ways to load pacts - Easy way to change assertion strategy - **org.junit.BeforeClass**, **org.junit.AfterClass** and **org.junit.ClassRule** JUnit annotations, that will be run once - before/after whole contract test suite. - **org.junit.Before**, **org.junit.After** and **org.junit.Rule** JUnit annotations, that will be run before/after each test of an interaction. - **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. ## Example of HTTP test ```java @RunWith(PactRunner.class) // Say JUnit to run tests with custom Runner @Provider(&quot;myAwesomeService&quot;) // Set up name of tested provider @PactFolder(&quot;pacts&quot;) // Point where to find pacts (See also section Pacts source in documentation) public class ContractTest { // NOTE: this is just an example of embedded service that listens to requests, you should start here real service @ClassRule //Rule will be applied once: before/after whole contract test suite public static final ClientDriverRule embeddedService = new ClientDriverRule(8332); @BeforeClass //Method will be run once: before whole contract test suite public static void setUpService() { //Run DB, create schema //Run service //... } @Before //Method will be run before each test of interaction public void before() { // Rest data // Mock dependent service responses // ... embeddedService.addExpectation( onRequestTo(&quot;/data&quot;), giveEmptyResponse() ); } @State(&quot;default&quot;, &quot;no-data&quot;) // Method will be run before testing interactions that require &quot;default&quot; or &quot;no-data&quot; state public void toDefaultState() { // Prepare service before interaction that require &quot;default&quot; state // ... System.out.println(&quot;Now service in default state&quot;); } @TestTarget // Annotation denotes Target that will be used for tests public final Target target = new HttpTarget(8332); // Out-of-the-box implementation of Target (for more information take a look at Test Target section) } ``` ## Example of AMQP Message test ```java @RunWith(PactRunner.class) // Say JUnit to run tests with custom Runner @Provider(&quot;myAwesomeService&quot;) // Set up name of tested provider @PactBroker(host=&quot;pactbroker&quot;, port = &quot;80&quot;) public class ConfirmationKafkaContractTest { @TestTarget // Annotation denotes Target that will be used for tests public final Target target = new AmqpTarget(); // Out-of-the-box implementation of Target (for more information take a look at Test Target section) @BeforeClass //Method will be run once: before whole contract test suite public static void setUpService() { //Run DB, create schema //Run service //... } @Before //Method will be run before each test of interaction public void before() { // Message data preparation // ... } @PactVerifyProvider(&apos;an order confirmation message&apos;) String verifyMessageForOrder() { Order order = new Order() order.setId(10000004) order.setPrice(BigDecimal.TEN) order.setUnits(15) def message = new ConfirmationKafkaMessageBuilder() .withOrder(order) .build() JsonOutput.toJson(message) } } ``` ## Pact source The Pact runner will automatically collect pacts based on annotations on the test class. For this purpose there are 3 out-of-the-box options (files from a directory, files from a set of URLs or a pact broker) or you can easily add your own Pact source. **Note:** You can only define one source of pacts per test class. ### Download pacts from a pact-broker To use pacts from a Pact Broker, annotate the test class with `@PactBroker(host=&quot;host.of.pact.broker.com&quot;, port = &quot;80&quot;)`. From _version 3.2.2/2.4.3+_ you can also specify the protocol, which defaults to &quot;http&quot;. The pact broker will be queried for all pacts with the same name as the provider annotation. For example, test all pacts for the &quot;Activity Service&quot; in the pact broker: ```java @RunWith(PactRunner.class) @Provider(&quot;Activity Service&quot;) @PactBroker(host = &quot;localhost&quot;, port = &quot;80&quot;) public class PactJUnitTest { @TestTarget public final Target target = new HttpTarget(5050); } ``` #### _Version 3.2.3/2.4.4+_ - Using Java System properties The pact broker loader was updated to allow system properties to be used for the hostname, port or protocol. The port was changed to a string to allow expressions to be set. To use a system property or environment variable, you can place the property name in `${}` expression de-markers: ```java @PactBroker(host=&quot;${pactbroker.hostname}&quot;, port = &quot;80&quot;) ``` You can provide a default value by separating the property name with a colon (`:`): ```java @PactBroker(host=&quot;${pactbroker.hostname:localhost}&quot;, port = &quot;80&quot;) ``` #### _Version ???/???+_ - More Java System properties The default values of the `@PactBroker` annotation now enable variable interpolation. The following keys may be managed through the environment * `pactbroker.host` * `pactbroker.port` * `pactbroker.protocol` * `pactbroker.tags` (comma separated) * `pactbroker.auth.scheme` * `pactbroker.auth.username` * `pactbroker.auth.password` #### _Version 3.2.4/2.4.6+_ - Using tags with the pact broker The pact broker allows different versions to be tagged. To load all the pacts: ```java @PactBroker(host=&quot;pactbroker&quot;, port = &quot;80&quot;, tags = {&quot;latest&quot;, &quot;dev&quot;, &quot;prod&quot;}) ``` The default value for tags is `latest` which is not actually a tag but instead corresponds to the latest version ignoring the tags. If there are multiple consumers matching the name specified in the provider annotation then the latest pact for each of the consumers is loaded. For any other value the latest pact tagged with the specified tag is loaded. Specifying multiple tags is an OR operation. For example if you specify `tags = {&quot;dev&quot;, &quot;prod&quot;}` then both the latest pact file tagged with `dev` and the latest pact file taggged with `prod` is loaded. #### _Version 3.3.4/2.4.19+_ - Using basic auth with the with the pact broker You can use basic authentication with the `@PactBroker` annotation by setting the `authentication` value to a `@PactBrokerAuth` annotation. For example: ```java @PactBroker(host = &quot;${pactbroker.url:localhost}&quot;, port = &quot;1234&quot;, tags = {&quot;latest&quot;, &quot;prod&quot;, &quot;dev&quot;}, authentication = @PactBrokerAuth(username = &quot;test&quot;, password = &quot;test&quot;)) ``` The `username` and `password` values also take Java system property expressions. ### Pact Url To use pacts from urls annotate the test class with ```java @PactUrl(urls = {&quot;http://build.server/zoo_app-animal_service.json&quot;} ) ``` ### Pact folder To use pacts from a resource folder of the project annotate test class with ```java @PactFolder(&quot;subfolder/in/resource/directory&quot;) ``` ### Custom pacts source It&apos;s possible to use a custom Pact source. For this, implement interface `au.com.dius.pact.provider.junit.loader.PactLoader` and annotate the test class with `@PactSource(MyOwnPactLoader.class)`. **Note:** class `MyOwnPactLoader` must have a default empty constructor or a constructor with one argument of class `Class` which at runtime will be the test class so you can get custom annotations of test class. ## Test target The field in test class of type `au.com.dius.pact.provider.junit.target.Target` annotated with `au.com.dius.pact.provider.junit.target.TestTarget` will be used for actual Interaction execution and asserting of contract. **Note:** there must be exactly 1 such field, otherwise an `InitializationException` will be thrown. ### HttpTarget `au.com.dius.pact.provider.junit.target.HttpTarget` - out-of-the-box implementation of `au.com.dius.pact.provider.junit.target.Target` that will play pacts as http request and assert response from service by matching rules from pact. _Version 3.2.2/2.4.3+_ you can also specify the protocol, defaults to &quot;http&quot;. ### AmqpTarget `au.com.dius.pact.provider.junit.target.AmqpTarget` - out-of-the-box implementation of `au.com.dius.pact.provider.junit.target.Target` that will play pacts as an AMQP message and assert response from service by matching rules from pact. #### Modifying the requests before they are sent [Version 3.2.3/2.4.5+] 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 HttpTarget supports request filters by annotating methods on the test class with `@TargetRequestFilter`. These methods must be public void methods that take a single HttpRequest parameter. For example: ```java @TargetRequestFilter public void exampleRequestFilter(HttpRequest request) { request.addHeader(&quot;Authorization&quot;, &quot;OAUTH hdsagasjhgdjashgdah...&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! #### 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. ### Custom Test Target It&apos;s possible to use custom `Target`, for that interface `Target` should be implemented and this class can be used instead of `HttpTarget`. # Verification Reports [versions 3.2.7/2.4.9+] The default test behaviour is to display the verification being done to the console, and pass or fail the test via the normal JUnit mechanism. From versions 3.2.7/2.4.9+, additional reports can be generated from the tests. ## Enabling additional reports via annotations on the test classes A `@VerificationReports` annotation can be added to any pact test class which will control the verification output. The annotation takes a list report types and an optional report directory (defaults to &quot;target/pact/reports&quot;). The currently supported report types are `console`, `markdown` and `json`. For example: ```java @VerificationReports({&quot;console&quot;, &quot;markdown&quot;}) public class MyPactTest { ``` will enable the markdown report in addition to the normal console output. And, ```java @VerificationReports(value = {&quot;markdown&quot;}, reportDir = &quot;/myreports&quot;) public class MyPactTest { ``` will disable the normal console output and write the markdown reports to &quot;/myreports&quot;. ## Enabling additional reports via Java system properties or environment variables The additional reports can also be enabled with Java System properties or environment variables. The following two properties have been introduced: `pact.verification.reports` and `pact.verification.reportDir`. `pact.verification.reports` is the comma separated list of report types to enable (e.g. `console,json,markdown`). `pact.verification.reportDir` is the directory to write reports to (defaults to &quot;target/pact/reports&quot;). ## Additional Reports The following report types are available in addition to console output (`console`, which is enabled by default): `markdown`, `json`. You can also provide a fully qualified classname as report so custom reports are also supported. This class must implement `au.com.dius.pact.provider.reporters.VerifierReporter` interface in order to be correct custom implementation of a report.

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

3 downloads
Artifact pact-jvm-provider-junit_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 9
Dependencies slf4j-api, scala-library, pact-jvm-provider_2.10, fluent-hc, httpclient, junit, commons-lang3, jackson-databind, commons-collections4,
There are maybe transitive dependencies!



Page 289 from 290 (items total 2892)


© 2015 - 2024 Weber Informatics LLC | Privacy Policy