https://pact.io logo
Join Slack
Powered by
# pact-jvm
  • f

    Francislainy Campos

    12/01/2022, 12:01 PM
    I’m putting this here https://stackoverflow.com/questions/74641538/how-to-inject-dynamic-id-for-body-of-pact-contract-written-in-java
  • k

    Krishna Mohan Elluru

    12/05/2022, 12:42 PM
    HI All, https://mvnrepository.com/artifact/au.com.dius/pact-jvm-provider-maven suggests latest version of pact-jvm is 4.0.10 and it is as old as 2 yrs. is this the latest? should I use pact-jvm or au.com.dius.pact.provider-maven for my maven builds? I see both are redundant and the examples in https://docs.pact.io/implementation_guides/jvm/provider/maven refer to pact-jvm though.
    u
    • 2
    • 1
  • b

    Basu Silviu

    12/05/2022, 4:58 PM
    hi guys, Anyone knows if there's a
    Pact Junit 5 Extension
    compiled in Java 8? It is impossible to move our monolith to Java 11, and I need to make use of the
    PactBrokerConsumerVersionSelectors
    m
    • 2
    • 2
  • r

    Riley Martine

    12/06/2022, 10:29 PM
    I feel like I'm missing something obvious -- what's the equivalent of
    .given
    for a
    consumer.dsl.PactBuilder
    ? I'm trying to set a provider state on a pact, using the plugins framework. Working off of the example here.
    u
    • 2
    • 2
  • g

    GitHub

    12/07/2022, 8:21 PM
    The GitHub user bethesque has signed out. Use the following command/s to recreate subscriptions /github subscribe pact-foundation/pact-jvm
  • b

    Beth (pactflow.io/Pact Broker/pact-ruby)

    12/08/2022, 12:35 AM
    /github subscribe pact-foundation/pact-jvm
  • r

    Riley Martine

    12/08/2022, 9:18 PM
    We have our protobuf files distributed as an artifact that's part of a dependency's JAR, and need to extract the file in order to pass a path to the gRPC plugin. I figured I'd share the snippet I came up with, in case it's of use to others, or anyone has a better method 🙂
    snippet.java
    🙌 3
    u
    y
    • 3
    • 2
  • j

    Jayachandra K

    12/10/2022, 11:04 PM
    Hey All 👋 , is there an automated way to update
    repositoryUrl
    for the pacticipants? I don’t want to use pact API . I would be keen to know to update the url while publishing pacts or running the tests
    u
    • 2
    • 2
  • é

    Édouard Lopez

    12/12/2022, 9:16 AM
    Hello, I got the following feedback from a teammate
    Hi there!
    A small issue we just encounter with PACT. Our PACT consumer is green and was validated by the provider, so all seems good. But then, when we did our first test and we are facing a deserialization issue on the provider side. After investigating, the consumer is not serializing in the right way an enumeration value. The provider is expecting "`customer_order`" and the consumer is sending "`CUSTOMER_ORDER`".
    So I did some test on the consumer, to understand why this has not broken the PACT on the consumer side. And it seems that the PACT consumer will broke if an expected field in the request is missing, but not if the values does not match... I am a bit sad about this behavior, I was expected the PACT to fully validate the body, field and value. This mean, we need to write additional integration test to validate the serialization of the consumer, not cool 😕! Or maybe we are missing a configuration somewhere? I haven't found something yet
    His solution was to implement a matcher on the request field.
    Copy code
    .stringMatcher(
                "issuer_type",
                "^("
                    + Arrays.stream(IssuerTypeDTO.values())
                        .map(IssuerTypeDTO::getCode)
                        .collect(Collectors.joining("|"))
                    + ")",
                IssuerTypeDTO.CUSTOMER_ORDER.getCode())
    I'm aware that Pact is not strict in the response's value but was expecting more control on the request content as per Postel's Law. Should
    m
    f
    • 3
    • 8
  • u

    uglyog

    12/14/2022, 11:54 PM
    /github subscribe pact-foundation/pact-jvm issues, releases
  • u

    uglyog

    12/14/2022, 11:56 PM
    /github subscribe pact-foundation/pact-jvm commits
  • u

    uglyog

    12/14/2022, 11:56 PM
    /github unsubscribe pact-foundation/pact-jvm commits
  • u

    uglyog

    12/14/2022, 11:56 PM
    /github unsubscribe pact-foundation/pact-jvm issues
  • u

    uglyog

    12/14/2022, 11:57 PM
    /github unsubscribe pact-foundation/pact-jvm pulls
  • l

    Laith

    12/21/2022, 3:24 PM
    Hi, I’m using v4.1.39 of the junit5 provider plugin to verify pacts with a pact broker with basic auth enabled. I’m trying to pass in the password to the
    @PactBrokerAuth
    annotation using a java system property, since the documentation says, “the
    token
    ,
    username
    and
    password
    values also take Java system property expressions”. A quick google of java system property expressions led me to Spring expression language, so I tried
    password = "#{systemProperties['pact.broker.password']}"
    , and also
    password = "System.getProperty(\"pact.broker.password\")"
    (where I’ve defined
    pact.broker.password
    on the command line), but in both cases the string was interpreted literally. I’m not too familiar with spring, or java for that matter, would you be able to help me get the syntax right? Thanks
    u
    • 2
    • 2
  • g

    GitHub

    12/23/2022, 1:25 AM
    Release - 4.1.41 New release published by rholshausen fix: write date/time matchers in the correct format as per the spec • 00ce375 - fix: write date/time matchers in the correct format as per the spec #1617 • f825173 - chore: Upgrade Gradle to 6.4.1 • aba556c - fix: Update matching rule loading code to support correct + incorrect formatted date/time matchers #1617 pact-foundation/pact-jvm
  • g

    GitHub

    12/23/2022, 3:23 AM
    Release - 4.3.18 New release published by rholshausen fix: write date/time matchers in the correct format as per the spec • b1d6c01 - fix: write date/time matchers in the correct format as per the spec #1617 • aa11791 - fix: Update matching rule loading code to support correct + incorrect formatted date/time matchers #1617 • d079d45 - chore: correct build on JDK 16+ • 1488826 - chore: Upgrade Gradle to 7.5.1 pact-foundation/pact-jvm
  • g

    GitHub

    12/23/2022, 4:11 AM
    Release - 4.4.3 New release published by rholshausen Bugfixes + write date/time matchers in the correct format as per the spec • b1d6c01 - fix: write date/time matchers in the correct format as per the spec #1617 • aa11791 - fix: Update matching rule loading code to support correct + incorrect formatted date/time matchers #1617 • 1488826 - chore: Upgrade Gradle to 7.5.1 • c9a62cc - refactor: performance improvements in core/matchers module (Matchers, Matching, CollectionUtils) (Tomasz Linkowski) • 21af9f5 - refactor: add missing test case for #1347 (Tomasz Linkowski) • 102e673 - bugfix: fix custom header propagation in list case (Artem Ptushkin) pact-foundation/pact-jvm
    🎉 1
  • k

    Karol Stępień

    12/23/2022, 10:49 AM
    Hi everyone, I'm looking for help with pact maven plugin. I'm trying to run verification from maven command
    mvn pact:verify -Dpact.filter.pacturl=<https://pact-broker>....
    but I got 401 and I don't know how to pass username and password my pom.xml setup is following
    Copy code
    <plugin>
                    <groupId>au.com.dius.pact.provider</groupId>
                    <artifactId>maven</artifactId>
                    <version>4.3.12</version>
    
                    <configuration>
                        <serviceProviders>
                            <serviceProvider>
                                <name>providerName</name>
                                <consumers>
                                    <consumer>
                                        <name>consumerName</name>
                                    </consumer>
                                </consumers>
                            </serviceProvider>
                        </serviceProviders>
                    </configuration>
                </plugin>
    I was trying many things: 1. I used PactUrl annotation for running the same test from Intellij directly `@PactUrl(urls = {"https://pact-broker........"}, auth = @Authentication(username = "lalal", password = "lalal"))`and this is working fine ✅
  • m

    Michael Bailey

    12/15/2021, 7:29 PM
    General question about the jvm pact implementation: when I run provider tests, I’m finding it very hard to diagnose test failures - output sent from the test through println does not appear on the console, and debug statements are not hit. How do people track down issues?
    m
    f
    • 3
    • 24
  • o

    Oleksandr Yanov

    01/04/2023, 5:07 PM
    Hello #C9UN99H24 , does anyone had practice writing pacts for services with different programming languages? An example, nodejs service as a consumer and java service as a provider?
    j
    t
    v
    • 4
    • 4
  • v

    Viacheslav Karamov

    01/05/2023, 6:27 PM
    Hello, In a code taken from here there are tests:
    Copy code
    @ExtendWith(PactConsumerTestExt.class)
        @Pact(provider = "order_provider", consumer = "order_consumer")
        public V4Pact listOfOrdersPact(PactDslWithProvider builder) {
    .... 
        @Pact(provider = "order_provider", consumer = "order_consumer")
        public V4Pact noOrdersPact(PactDslWithProvider builder) {
    ...
    
        @Test
        @PactTestFor(pactMethod = "listOfOrdersPact")
        void getListOfOrders(MockServer mockServer) throws IOException {
    ...
        @Test
        @PactTestFor(pactMethod = "noOrdersPact")
        void getEmptyListOfOrders(MockServer mockServer) throws IOException {
    when I run any of these 2 tests I got an error:
    Copy code
    The following methods annotated with @Pact were not executed during the test: OrderApiClientPactTest.noOrdersPact If these are currently a work in progress, add a @Disabled annotation to the method
    Commenting out
    noOrdersPact
    and its test fixes the issue. How to fix that?
    • 1
    • 2
  • y

    Yogesh HS

    01/09/2023, 6:24 AM
    Hello, I am one of the PACT consumer, after upgrading to 4.0, It generates random strings (as example) to match the specified pattern and for some reason when it serializes those example string, it generates invalid sequence, It doesn't escape those strings in 4.0.x version that's the reason we don't see this issue before. we are getting below error
    Copy code
    {
      "error": {
        "message": "source sequence is illegal/malformed utf-8",
        "reference": "HjPEylMxlF"
      }
    }
    m
    u
    • 3
    • 13
  • s

    Simon Petty

    01/09/2023, 9:19 PM
    Hi. My company makes very heavy use of Kafka, and i've been interested recently in bi-directional contract testing. We use Avro schemas stored in a schema registry, so i'm aware that ours isn't a particularly common use-case for Pact. I've seen this on the roadmap: https://github.com/pactflow/roadmap/issues/32, so i'm curious about how i might be able to help. I'm new to Pact so I imagine getting to grips with how this works for messaging systems now is the first step?
  • k

    Kevin de Boer

    01/10/2023, 10:16 AM
    Hi, I have a simple consumer test in which I expect the producer to return a json array as response body. However when we ran the producer test, it turned out that the producer returns the array unordered. All the data is there, but the order is inequal. As the consumer, we don’t care about the order. So I assume I have to edit the pact in the consumer test to somehow specify that the order is irrelevant, but I have no how to do so. I believe this documentation here is relevant, but its hard to find example usages of it. Am I on the right track here?
    m
    s
    • 3
    • 8
  • h

    Harry

    01/13/2023, 6:56 AM
    Hi, is there any provision to write pact tests for the micronaut framework?
  • g

    GitHub

    01/16/2023, 2:19 AM
    Release - 4.3.19 New release published by rholshausen Maintenance Release • 5462dea - fix: remove the optional annotation from PactPublish attribute in PactPublishTask #1634 • 639f7f8 - fix(regression): HTTP Pact with root json array fails when using unordered array matching #1631 • be8d57d - fix(regression): Upgrading au.com.dius.pact.provider:junit5 from 4.3.15 to 4.3.16 results in compilation failure #1630 • 51c076f - chore: Upgrade Groovy to 3.0.14 pact-foundation/pact-jvm
  • t

    Thomas K

    01/18/2023, 10:48 AM
    hello, does anyone please know how i can do
    minArrayLike
    for an array of json objects in Kotlin lambda dsl please?
  • j

    James Fraser

    01/18/2023, 3:50 PM
    Hey folks 👋 does anyone know if it’s possible to write contract tests for Java services that communicate using JSON-RPC?
    m
    • 2
    • 9
  • g

    GitHub

    01/19/2023, 2:22 AM
    Release - 4.4.4 New release published by rholshausen Maintenance Release • 21b06cf - fix: Support IP6 hosts #405 • a8877b2 - fix: JUnit 4 tests were not running as the junit-vintage-engine was not on the test classpath • 7935300 - chore: fix test failing on Windows due to timezone issue #401 • 765bd61 - chore: add a test to verify issue PactDslJsonBody#eachKeyMappedToAnArrayLike does not work on "nested" property • ef276f8 - chore: add a test to verify issue PactDslJsonBody#eachKeyMappedToAnArrayLike does not work on "nested" property #401 • 859fff2 - feat: add the remaining status code methods to response DSL builder • 01dda6c - feat: add the remaining body methods to request/response DSL builders • 75ba28a - feat: Add support for query parameters with new DSL • b888d07 - feat: Add support for matching rules with headers with new DSL • 1d27922 - feat: Add initial DSL using builder pattern to replace legacy DSL • 0506476 - feat: add methods to setup provider states on PactBuilder #1646 • e8e5457 - fix: remove the optional annotation from PactPublish attribute in PactPublishTask #1634 • 030e46c - refactor: magic numbers (Samuel) • ba38e5d - feat: validate list type as per default (Samuel) • 639f7f8 - fix(regression): HTTP Pact with root json array fails when using unordered array matching #1631 • 4a5ff59 - fix: Use context.testMethod instead of context.requiredTestMethod #1643 • 58b6982 - fix: bug in how the @MockServerConfig annotation is being resolved #1641 • 09bb4af - feat: Update Groovy message builder to be able to create a message with a NULL body #1637 • be8d57d - fix(regression): Upgrading au.com.dius.pact.provider:junit5 from 4.3.15 to 4.3.16 results in compilation failure #1630 pact-foundation/pact-jvm
1...91011...14Latest