Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer-Driven Contracts integration/support #6276

Open
x80486 opened this issue Dec 19, 2019 · 8 comments
Open

Consumer-Driven Contracts integration/support #6276

x80486 opened this issue Dec 19, 2019 · 8 comments
Labels
kind/enhancement New feature or request

Comments

@x80486
Copy link
Contributor

x80486 commented Dec 19, 2019

Description

Having something like this, that works out-of-the-box without developers need to do all the Jiu Jitsu for the integration would come handy — even more for testing micro-services.

I'm thinking about integrating something like Pact JVM with abilities to test (a) contracts for REST or HTTP as a means of communication, (b) message brokers (like the output from a method or a message), (c) you name it.

One can achieve something similar by using JsonSchemaValidator.matchesJsonSchemaInClasspath, but that wouldn't be a "clear way" to define the contracts:

RestAssured.given()
  .when()
    .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
    .get(Constant.Uri.Comments)
  .then()
    .body("$.size()", Matchers.greaterThanOrEqualTo(4))
    .body(JsonSchemaValidator.matchesJsonSchemaInClasspath("schema/json/comments__get-all.json"))
    .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
    .statusCode(HttpStatus.SC_OK);
@x80486 x80486 added the kind/enhancement New feature or request label Dec 19, 2019
@bpechiney
Copy link

Has there been any work done to support contract testing in Quarkus?

@dicolasi
Copy link

Same question here :)

@ambition-consulting
Copy link

It's a shame that a framework, which is meant for microservice orchestration, has only testing support for monolithic applications. We need orchestration support like provided by spring-cloud-contracts or pact.

@wabrit
Copy link

wabrit commented Jul 29, 2021

I would agree with @ambition-consulting - CDC is a big part of our Spring Boot microservice qa process, and it would be very desirable to have an equivalent in quarkus. Ideally the framework should be language-agnostic so that e.g. contracts published by a Quarkus microservice producer can be tested by a Nodejs consumer - spring-cloud-contracts AFAIK does not support that.

@ambition-consulting
Copy link

Apparently Pact tests can at least get executed again with Quarkus 2: https://github.com/skattela/pact-workshop-jvm-quarkus

@holly-cummins
Copy link
Contributor

See #27729, which is arguably a duplicate of this, but with the extension-proposal type.

@holly-cummins
Copy link
Contributor

See also #9677 which sets many pact artifacts to be parentfirst in a core pom, with a comment

                        <!-- Pact[<4.1.0] support. It would be great if there was somewhere better to put this-->

Those updates should perhaps? move to this extension once implemented.

@holly-cummins
Copy link
Contributor

See https://github.com/quarkiverse/quarkus-pact/, and also https://www.youtube.com/watch?v=d9CSY8HuZ9U, which discusses some of the roadmap for CDC support in Quarkus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants