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

    Denys

    02/18/2025, 3:46 PM
    Hi team! I have a problem THIS IS MY TEST CLASS :
    Copy code
    @ExtendWith(PactConsumerTestExt.class)
    @PactTestFor(providerName = "P01823-TS-Trade-Store", pactVersion = PactSpecVersion.V4, providerType = ProviderType.SYNCH_MESSAGE)
    class GetTradesByFilterProductTypeFXFWDTest {
    
        ManagedChannel channel;
        @BeforeEach
        void setUp(MockServer mockServer) {
            System.setProperty("pact_do_not_track", "true");
    
        }
    
        ////////////////// 1. GetTradesByFilter product types
        @Pact(consumer = "P01819-ipa-mi")
        public V4Pact tradesByFilterProductTypeFXFWD(PactBuilder builder) {
            return builder
                    .usingPlugin("protobuf")
                    .expectsToReceive("a get trade by filter request", "core/interaction/synchronous-message")
                    .with(Map.of(
                            "pact:proto", filePath("proto/tsServiceV2.proto"),
                            "pact:content-type", "application/grpc",
                            "pact:proto-service", "TradeStoreService/GetTradesByFilter",
                            "pact:protobuf-config", Map.of(
                                    "additionalIncludes",
                                    List.of(filePath("proto/tsService.proto"))),
    
                            // Details on the request message
                            "request", Map.of(
                                    "productTypes",
                                    Map.of("value",
                                            "matching(equalTo, 'FXFWD')")),
    
                            // Details on the response
                            "response",
                            Map.of("trade_key",
                                    Map.of("product_type", "matching(equalTo, 'FXFWD')")))
                    ).toPact();
        }
    
    
        @Test
        @PactTestFor(pactMethod = "tradesByFilterProductTypeFXFWD")
        @MockServerConfig(implementation = MockServerImplementation.Plugin, registryEntry = "protobuf/transport/grpc")
        void testTradesByFilterProductTypeFXFWD(MockServer mockServer, V4Interaction.SynchronousMessages interaction) throws InvalidProtocolBufferException, InterruptedException {
            boolean success = false;
            ManagedChannel channel = ManagedChannelBuilder.forTarget("127.0.0.1:" + mockServer.getPort())
                    .usePlaintext()
                    .build();
            try {
                TradeStoreServiceGrpc.TradeStoreServiceBlockingStub stub = TradeStoreServiceGrpc.newBlockingStub(channel);
    
                ts.api.TsServiceV2.TradeFilter tradeFilter = ts.api.TsServiceV2.TradeFilter.parseFrom(interaction.getRequest().getContents().getValue());
    
                Iterator<TsService.Trade> responseTrade = stub.getTradesByFilter(tradeFilter);
    
                assertThat(responseTrade).as("getTradeByFilter is null").isNotNull();
            } finally {
                if (!success) {
                    channel.awaitTermination(10, TimeUnit.SECONDS);
                    channel.shutdown();
                }
            }
        }
        @Pact(consumer = "P01819-ipa-mi")
        public V4Pact tradesByFilterProductTypeFXFWDONE(PactBuilder builder) {
            return builder
                    .usingPlugin("protobuf")
                    .expectsToReceive("a get trade by filter request", "core/interaction/synchronous-message")
                    .with(Map.of(
                            "pact:proto", filePath("proto/tsServiceV2.proto"),
                            "pact:content-type", "application/grpc",
                            "pact:proto-service", "TradeStoreService/GetTradesByFilter",
                            "pact:protobuf-config", Map.of(
                                    "additionalIncludes",
                                    List.of(filePath("proto/tsService.proto"))),
    
                            // Details on the request message
                            "request", Map.of(
                                    "productTypes",
                                    Map.of("value",
                                            "matching(equalTo, 'FXFWD')")),
    
                            // Details on the response
                            "response",
                            Map.of("trade_key",
                                    Map.of("product_type", "matching(equalTo, 'FXFWD')")))
                    ).toPact();
        }
    
    
        @Test
        @PactTestFor(pactMethod = "tradesByFilterProductTypeFXFWDONE")
        @MockServerConfig(implementation = MockServerImplementation.Plugin, registryEntry = "protobuf/transport/grpc")
        void testTradesByFilterProductTypeFXFWDONE(MockServer mockServer, V4Interaction.SynchronousMessages interaction) throws InvalidProtocolBufferException, InterruptedException {
            boolean success = false;
            ManagedChannel channel = ManagedChannelBuilder.forTarget("127.0.0.1:" + mockServer.getPort())
                    .usePlaintext()
                    .build();
            try {
                TradeStoreServiceGrpc.TradeStoreServiceBlockingStub stub = TradeStoreServiceGrpc.newBlockingStub(channel);
    
                ts.api.TsServiceV2.TradeFilter tradeFilter = ts.api.TsServiceV2.TradeFilter.parseFrom(interaction.getRequest().getContents().getValue());
    
                Iterator<TsService.Trade> responseTrade = stub.getTradesByFilter(tradeFilter);
    
                assertThat(responseTrade).as("getTradeByFilter is null").isNotNull();
            } finally {
                if (!success) {
                    channel.awaitTermination(10, TimeUnit.SECONDS);
                    channel.shutdown();
                }
            }
        }
    }
    After running all class I have an error:
    2025-02-18 17:34:46,081 ERROR [main] [:] io.pact.plugins.jvm.core.DefaultPluginManager: Failed to initialise the plugin
    io.grpc.StatusRuntimeException: UNAVAILABLE: io exception at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:351) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:332) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:174) at io.pact.plugin.PactPluginGrpc$PactPluginBlockingStub.initPlugin(PactPluginGrpc.java:641) at io.pact.plugins.jvm.core.DefaultPluginManager.initPlugin$lambda$37(PluginManager.kt:913) at io.pact.plugins.jvm.core.DefaultPactPlugin.withGrpcStub(PluginManager.kt:267) at io.pact.plugins.jvm.core.DefaultPluginManager.initPlugin(PluginManager.kt:913) at io.pact.plugins.jvm.core.DefaultPluginManager.tryInitPlugin(PluginManager.kt:892) at io.pact.plugins.jvm.core.DefaultPluginManager.initialisePlugin(PluginManager.kt:866) at io.pact.plugins.jvm.core.DefaultPluginManager.loadPlugin(PluginManager.kt:419) at au.com.dius.pact.consumer.dsl.PactBuilder.usingPlugin(PactBuilder.kt:113) at au.com.dius.pact.consumer.dsl.PactBuilder.usingPlugin$default(PactBuilder.kt:110) at au.com.dius.pact.consumer.dsl.PactBuilder.usingPlugin(PactBuilder.kt) at com.ing.ipami.pact.product_type.GetTradesByFilterProductTypeFXFWDTest.tradesByFilterProductTypeFXFWDONE(GetTradesByFilterProductTypeFXFWDTest.java:101) Caused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt: /[00000001]52748 Caused by: java.net.ConnectException: Connection refused: getsockopt Process finished with exit code 0 protobuf plugin V 0.5.4 is installed on my laptop Do you have any ideas why after running tested class PACT framework generated only one tested method inside contract/.json file? Thanks
    m
    • 2
    • 4
  • v

    vicky

    02/19/2025, 12:19 PM
    I am encountering an issue while running my provider tests in a Gradle Kotlin Spring Boot project. I have a contract with 10 test cases, and my provider tests are split across two files—one file covers 2 states, while the other handles 8 states. However, when I run my provider tests, the contract checks for all 10 states in each file instead of only the relevant ones. As a result, I get 10 passing tests but also 10 failing tests because each file is validating all the states, leading to incorrect failures. things i have already tried: 1. moving SpringBootTest to base call 2. https://stackoverflow.com/a/79264442 please help ASAP
    v
    m
    • 3
    • 2
  • h

    Haritima Haritima

    02/19/2025, 5:01 PM
    Hi there, need another help with my pact tests please The provider app(java springboot / Junit) that we have uses very different/ complex steps to initialise the application. The default pact provider verifier is not initialising it correctly and hence it fails while setting up the provider states. Is there a way I can point my pact verifier to already running provider app. (will initialise the provider seperately before executing the pact test)
    m
    • 2
    • 3
  • b

    Bas Dijkstra

    02/24/2025, 7:25 AM
    Quick question, but I can't find the answer in the docs and ChatGPT isn't helpful either: how can I set the Pact verifier output log level to DEBUG in Java? In other languages it's a configuration setting in the code but I can't find the right syntax. Thanks 🙂
    b
    m
    • 3
    • 8
  • s

    Shrinivas Khawase

    02/24/2025, 8:52 AM
    Hello Everyone , We have been trying to implement contract testing for android. We are using this library for it
    au.com.dius.pact.consumer:junit Version 4.6.14
    but we often get the error mentioned below which blocks our pipeline , has anyone else faced this ?Its not consistent but occurs randomly cc @Sitaram Appalla @Ramesh Kumar
    Copy code
    Failed to transform java-semver-0.9.0.jar (com.github.zafarkhaja:java-semver:0.9.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
          > Could not find java-semver-0.9.0.jar (com.github.zafarkhaja:java-semver:0.9.0).
            Searched in the following locations:
                <https://jitpack.io/com/github/zafarkhaja/java-semver/0.9.0/java-semver-0.9.0.jar>
    r
    r
    • 3
    • 4
  • o

    Oleksandr Verdiev

    02/24/2025, 9:58 AM
    Hello, could anybody please take a look into this issue? https://github.com/pact-foundation/pact-jvm/issues/1797 Long story short, i want to not hardcode datetime formats, since we are serializing Instant. and instant can have formats like these
    Copy code
    "yyyy-MM-dd'T'HH:mm:ssZ"
    "yyyy-MM-dd'T'HH:mm:ss.SSZ"
    "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
    ...
    "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSZ"
    I have tried these so far:
    Copy code
    return new PactDslJsonBody()
            .object("Data", looksLike()
                    .uuid("ConsentId")
                    .datetime("CreationDateTime", INSTANT_ISO_DATETIME_FORMAT, Instant.now())
    Copy code
    // "yyyy-MM-dd'T'HH:mm:ss[.[SSSSSSSSS][SSSSSSSS][SSSSSSS][SSSSSS][SSSSS][SSSS][SSS][SS][S]]'Z'";
    // static final String INSTANT_ISO_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSZ";
    // static final String INSTANT_ISO_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss[.SSSSSSSSS]Z";
    static final String INSTANT_ISO_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss(.SSSSSSSSS)?Z";
    r
    • 2
    • 7
  • p

    Paul Sobocinski

    02/24/2025, 7:00 PM
    Hi all! I'm having an issue getting the provided consumer test running against the example client (provided as a reference implementation). Specifically,
    provider.getUrl()
    is returning
    null
    , which in turn causes the test to fail before the
    ConsumerClient
    is even invoked. I have it set up the test and example its own repo here. The full error message I'm getting follows:
    Copy code
    [INFO] -------------------------------------------------------
    [INFO]  T E S T S
    [INFO] -------------------------------------------------------
    [INFO] Running exampleclients.ExampleJavaConsumerPactRuleTest
    Provider URL: null
    [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.027 s <<< FAILURE! - in exampleclients.ExampleJavaConsumerPactRuleTest
    [ERROR] runTest(exampleclients.ExampleJavaConsumerPactRuleTest)  Time elapsed: 0.017 s  <<< FAILURE!
    java.lang.AssertionError: Provider URL is null! Aborting test.
            at exampleclients.ExampleJavaConsumerPactRuleTest.runTest(ExampleJavaConsumerPactRuleTest.java:57)
    
    [INFO] 
    [INFO] Results:
    [INFO] 
    [ERROR] Failures: 
    [ERROR]   ExampleJavaConsumerPactRuleTest.runTest:57 Provider URL is null! Aborting test.
    [INFO] 
    [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
    [INFO] 
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    Versions used:
    JDK 1.8
    ;
    JUnit 4.8.2
    ;
    Pact-JVM 4.1.43
    m
    r
    • 3
    • 5
  • k

    Kusuma Guntamadugu

    02/25/2025, 4:15 AM
    Hi Team, Can I know how I can verify if a particular field has a specific value where this field can be present anywhere in the response (within array/objects). I tried below but the pact file generated fails at provider side
    Copy code
    val pactBody = PactDslJsonBody()
        .stringMatcher("test", "^(test1|test2)$")
    m
    r
    • 3
    • 10
  • p

    Przemyslaw Boszczyk

    03/04/2025, 10:34 AM
    Howdy folks. I'm having issues specifying rather simple pact for one of our consumers. The contract is defining a particular payload schema on POST call, where
    parameters
    field is a Map<String, String> of undefined size and fields.
    Copy code
    {
      "id": "string"
      "parameters": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    }
    I'm banging my head how to tackle it:
    Copy code
    @Pact(consumer = CONSUMER)
    RequestResponsePact pact(PactDslWithProvider builder) {
        return builder
                .uponReceiving("Post message")
                .path("/api/messages")
                .method("POST")
                .body(newJsonBody(body -> {
                    body.stringType("id", "example_id");
    //                    body.object("parameters", values -> values.eachLike())
                }).build())
                .matchHeader("Content-Type", "application/json.*", "application/json")
                .willRespondWith()
                .status(200)
                .toPact();
    }
    r
    • 2
    • 2
  • m

    Martin Mineo

    03/07/2025, 1:16 PM
    @Martin Mineo has left the channel
  • r

    Ruud Welling

    03/14/2025, 11:10 AM
    Hello, I am trying to implement a Synchronous message pact interaction. Where the consumer uses messaging to send a request message (command) and expects a response message back. The request body uses a field that is a value from the provider state. However when processing the message in the provider, then we do not receive the provider state variable in the message, but the example from the Consumer pact.
    Copy code
    @PactVerifyProvider("A command message")
        public MessageAndMetadata processCommand(MessageContents messageContents) {
            var jsonMessage = messageContents.getContents().valueAsString();
            // this json message does not have the provider state applied
            // instead it contains the example value provided by the consumer...
    
        }
    I tried to look for examples in the pact SDK, but could not really find any. Am I doing this in the right way? Is provider state supported in message pacts?
    • 1
    • 3
  • n

    Neha Munjal

    03/14/2025, 11:47 PM
    Hi Team, We are looking for an option to tag PACT tests with a specific identifier/version. The use case is having a version already promoted to PROD which should use say version x for provider verification and version y for PACTS being written for provider that is still in DEV. How can we specifically tag the PACT file and have the provider select PACTS only corresponding to that version, so that there are no issues running the PACT tests across multiple branches/deployments. Any specific examples for both configuration on consumer side as well as producer side would help.
    m
    • 2
    • 4
  • r

    Ruud Welling

    03/19/2025, 4:36 PM
    Hello. I am trying to create a synchronous message pact consumer test. I have defined the pact context and am working on the corresponding consumer test:
    Copy code
    @Test
        @PactTestFor(pactMethod = "mySyncMessagePact")
        void mySyncMessagePact(V4Interaction.SynchronousMessages interaction) {
          String request = "{}"; // 1: should call a method that produces the request
          // 2: Validate that the request is okay according to the pact
          // 3: Validate that the response message can be handled
        }
    How do I validate that the request message is compliant with the pact that I specified? After looking at the library code I could not find a standard utility that allows me to easily validate this
    r
    • 2
    • 4
  • r

    Ryan Quinn

    03/25/2025, 4:19 AM
    If I have the
    @AllowOverridePactUrl
    annotation set, how do I run that test class as part of my regular pipeline? It works fine when I get a request from a webhook, but I don't know how to create the appropriate URLs when running from my build pipeline. Am I confused about something?
    r
    • 2
    • 2
  • c

    Chandramani Jha

    03/26/2025, 1:22 PM
    Hi Team, Greetings of the day!! I am setting up a Pact contract test for Kafka (MessagePact) and need some guidance. Do we need to spin up a real Kafka instance when writing a consumer contract test? Also, is a Kafka instance required for provider verification? If there are any examples available, please share them. Thanks.
    y
    • 2
    • 15
  • s

    Slackbot

    03/26/2025, 1:22 PM
    https://docs.pact.io/getting_started/how_pact_works#how-to-write-message-pact-tests
  • e

    Erich Zimmerman

    03/27/2025, 3:34 PM
    Greetings! I am validating a reasonable complex JSON return from a service (which I hope to simplify moving forward), but I am running into a matching issue: One of the nested objects has a unique name (not standardized), based on the request. In the below example, "ABCD32" is the name, but in a different call, it may be something else.
    Copy code
    {
      "plans": {
        "ABCD32": {
          "idRequired": true,
          "ids": [
            "1234"
          ]
        }
      }
    }
    I'm trying to use
    object(<name>)
    for this, but the name isn't generally predictable.
    Copy code
    rootResponseObject.object("plans", (plans) ->
        plans.object("??????", (plan) -> {
             ratePlan.booleanType("idRequired", true);
             ratePlan.array("ids", (item) -> item.stringType("12345"));
        })
    );
    I think I'm a bit confused on when we want things to be more general, and when "test by example" is the right way to go. Since I control the request and data, should I just match to that exact string as the result that fulfills the example?
    r
    • 2
    • 3
  • a

    Adrien DEVILLERS

    03/28/2025, 10:41 AM
    Hello everyone, I have a question about provider states it may be a bit general but since we are implementing pact with pact-jvm I post it here. Please let me know if I should post it elsewhere. When we have a provider state on an interaction that is not implemented in the provider verifier, it will fall in the default case. As a result our server doesn't behave as expected and we might not know right away that it comes from our "dummy" provider state. This lead to some painful debugging. I understand it might not be easy to workaround but I wanted to have your take on this ? Thanks in advance
    r
    • 2
    • 4
  • r

    Ruth

    04/08/2025, 9:01 AM
    Hi, I am currently trying to use an Object containing Jodatime as a parameter. unfortunately I then get the error:
    Copy code
    java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter cannot access a member of class org.joda.time.LocalDate with modifiers "private final"
    kotlin.reflect.full.IllegalCallableAccessException: java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter cannot access a member of class org.joda.time.LocalDate with modifiers "private final"
    	at kotlin.reflect.jvm.internal.KCallableImpl.call
    Any idea what I can do? Can I use my own serializer, eg. objectMapper?
  • b

    Bas Dijkstra

    04/08/2025, 2:11 PM
    So, I'm trying to wrap my head around branches, especially on the provider side. I used to verify my contracts using
    mvn
    , and because my provider is a Spring service, this works fine:
    mvn clean "-Dpact.verifier.publishResults=true" "-Dpact.provider.version=1.0.0-address-ee07f8c04721b90be743fc1c08946663f01e6e46" test
    However, I now also want to list the provider branch, but when I try this (following the docs):
    mvn clean "-Dpact.verifier.publishResults=true" "-Dpact.provider.version=1.0.0-address-ee07f8c04721b90be743fc1c08946663f01e6e46" "-Dpactbroker.providerBranch=main" test
    It does not record the provider branch. Any ideas? Is this even important? I know I will need it in the next step, when I'll introduce pending pacts...
    r
    • 2
    • 3
  • s

    Shaiju B

    04/21/2025, 4:02 AM
    👋 Hello, team! I am trying to setup a sample PACT project with spring boot. After adding the below dependency for the pact concumer I found that one of the class is missing in dependency Dependency
    Copy code
    <dependency>
        <groupId>au.com.dius.pact.consumer</groupId>
        <artifactId>junit5</artifactId>
        <version>4.3.6</version>
        <scope>test</scope>
    </dependency>
    Class
    Copy code
    @au.com.dius.pact.consumer.junit5.Pact
    Any suggestion on how I could resolve this ?
    j
    • 2
    • 2
  • t

    Truth Opaleye

    04/23/2025, 10:28 PM
    Hello everyone, I'm looking for some clarity on what stringType() and numberType() methods are matching on using them to construct a jsonBody. My provider is verifying the pact generated using this method but it's using the example parameter as the literal value to compare against. For example i see error messages like "1.14) body: $payment.paymentAmount Expected null (Null) to be an integer" when providing something like .object("payment").numberType("paymentAmount").closeObject(). Any ideas?
    m
    • 2
    • 10
  • r

    Rishav Singh

    05/14/2025, 3:49 PM
    Hi team!, can you please help me understand why I am getting this error, my builder is return V4Pact also ?
    Copy code
    java.lang.UnsupportedOperationException: Method createPact does not conform required method signature 'public au.com.dius.pact.core.model.V4Pact xxx(PactBuilder builder)'
     at au.com.dius.pact.consumer.junit.JUnitTestSupport.conformsToSignature(JUnitTestSupport.kt:35)
     at au.com.dius.pact.consumer.junit5.PactConsumerTestExt.lookupPact(PactConsumerTestExt.kt:504)
     at au.com.dius.pact.consumer.junit5.PactConsumerTestExt.setupPactForTest(PactConsumerTestExt.kt:270)
     at au.com.dius.pact.consumer.junit5.PactConsumerTestExt.setupMockServerForProvider(PactConsumerTestExt.kt:248)
     at au.com.dius.pact.consumer.junit5.PactConsumerTestExt.beforeTestExecution(PactConsumerTestExt.kt:223)
     at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
     at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
    r
    m
    • 3
    • 8
  • s

    Simon Raess

    05/16/2025, 1:15 PM
    I was reading on pending pacts and how to use with Pact JVM. The system properties mention that besides setting pactbroker.enablePending = true you also have to provide pactbroker.providerBranch or pactbroker.providerTags. Why is that? The language agnostic doc does not mention anything about that.
    r
    m
    • 3
    • 3
  • r

    Rishav Singh

    05/19/2025, 1:24 PM
    Hi, I have created couple of consumer tests using Junit5, they pass and generate pacts also, but when I run either of them, I get this error at class level
    java.lang.AssertionError: The following methods annotated with @Pact were not executed during the test: RulesApiConsumerTest.createPactFor200
    If these are currently a work in progress, add a @Disabled annotation to the method
    I don't see this error when I run them together I have also used
    PactTestFor
    to categorize the tests with their respective method inside my test class
    r
    • 2
    • 9
  • j

    James P

    05/20/2025, 3:57 PM
    Hi, We are having some intermittent issues when publishing consumer contracts. We are getting the below error in CI:
    Copy code
    Request to path '**********************************************contracts/publish' failed with HTTP response 500
    JSON Response:
    {
      "error": {
        "message": "source sequence is illegal/malformed utf-8",
        "reference": "YeJQYFKhHV"
      }
    }
    I think its related to use using the
    .matchQuery("version", "1.0.0")
    as the value become encoded and then shows as
    "1\uB0D60\uB3DA0"
    in the contract. We also have a header using
    .matchHeader("header", ".*")
    which becomes encoded itself and then appears in the broker as
    "屏啾"
    . We are publishing using the pact gradle plugin and the command
    ./gradlew pactPublish
    . Weirdly though, the pipeline failed twice to publish and then with a retry for a third time it passed. I have suggested to the team to use
    encodedQuery
    and to change the header value as its not important for the service we are using but I’m curious to know why it would fail to publish but then eventually pass with no changes, is there some sort of race condition there?
    r
    • 2
    • 2
  • g

    GitHub

    05/23/2025, 12:10 AM
    Release - 4_7_0-beta_1 New release published by rholshausen ## Upgrade Kotlin to 2.1 and update all dependencies • 7d50d98 - chore: Upgrade KTor to 3.1.3 #1863 • d17e612 - chore(compatibility-suite): Upgrade cucumber to latest • d015fa1 - chore: Update dependencies for all provider modules • 2fd11ab - chore: Update dependencies for all consumer modules • abe80d7 - chore: Update dependencies for all core modules • 52f0e8f - chore: Update codenarc and re-enable detekt • b090143 - chore: Upgrade all core dependencies #1863 • 751614f - chore: Correct CI build • 62ca919 - chore: Upgrade Kotlin to 2.1.21 #1863 • b365641 - fix: Only coerce strings to numbers when comparing headers and query parameters • 1b1cf84 - chore(compatibility-suite): Correct the shared steps after updating the compatibility suite • 8c5b0b1 - fix: Only split values of known multi-value headers #1852 • d7d3030 - fix: Matching rule paths for fields with only digits should not be written as indices #1851 • 5dba442 - fix: Lambda based DSL stringType method did not match the old DSL #1850 • 287b16c - feat: Pass any transport config to the plugin in the test context under the transport_config key • 80d8a87 - chore: Add example of a test with a pending interaction • 2d20163 - fix: Dependency conflict with org.slf4j:slf4j-api was causing Spring tests to fail • 38c0d27 - feat: Update LambdaDsl.newJsonArray to allow setting the number of examples • 19c663c - chore: The pact-jvm-server main spec was not configured correctly • 147a2a6 - fix: LambdaDslJsonArray has no datetime function #1839 • c791170 - chore: Update readme pact-foundation/pact-jvm
  • d

    Deepak Chandh

    05/26/2025, 12:09 PM
    Hi Folks, hope you're doing well. Please let me know if someone has encountered it. In pact, I have written a consumer contract and published it to pact broker, and that contract has 3 endpoints in it. Now in provider application I have 3 profiles and each profile is configured to one endpoint. I will be running my provider tests against only one profile at a time, and other 2 profile endpoints shouldn't get validated. How I can handle that in provider application. (In Spring boot)
    m
    • 2
    • 2
  • k

    Katrin Aleinik

    06/10/2025, 3:09 PM
    Looking for a working example of Pact contract tests with Feign Client (consumer side) Hi everyone! 👋 I’m currently working on setting up Pact contract tests for a consumer using Feign Client and was wondering if anyone has a recent, working example to share. I’ve found a few examples online, but many seem outdated or don’t quite match our setup. If you’ve implemented this recently or know of a good reference, I’d really appreciate any pointers! Thanks in advance! 🙏
    j
    • 2
    • 2
  • i

    Imran Khan

    06/16/2025, 11:45 AM
    👋 Hello, team! I’m starting to implement Contract Testing in our organization using Bazel Mono-repo with Pact. Has anyone set this up before or worked with Pact in a Bazel environment? I would appreciate any guidance. Issue: My test is running using a sandbox path, which gets deleted once the tests complete. I’ve tried changing the path using
    pact.rootDir
    and other configurations, but I’m still facing the same issue. Even after adding
    sleep
    before and after running the test cases, the tests pass, but the Pact contract file is not being generated. Any help or pointers on how to resolve this would be greatly appreciated. Thanks in advance! Logs when running TestCase (also looked for the path, by adding a print statement - but failed)
    Copy code
    bazel test --nocache_test_results //access-control/contracts/openapi/v1:AccessControlConsumerPactTest 
    
    INFO: Invocation ID: 16bab404-9cf2-4e69-88d9-c46f58ef4b02
    INFO: Analyzed target //access-control/contracts/openapi/v1:AccessControlConsumerPactTest (0 packages loaded, 252 targets configured).
    INFO: Found 1 test target...
    INFO: From Testing //access-control/contracts/openapi/v1:AccessControlConsumerPactTest:
    ==================== Test output for //access-control/contracts/openapi/v1:AccessControlConsumerPactTest:
    OpenJDK 64-Bit Server VM warning: Ignoring option --illegal-access=debug; support was removed in 17.0
    JUnit4 Test Runner
    WARNING: A terminally deprecated method in java.lang.System has been called
    WARNING: System::setSecurityManager has been called by com.google.testing.junit.runner.junit4.JUnit4Runner (file:/private/var/tmp/_bazel_imrankhan/b141c088e4409f9b6c4d0f13116258fa/external/remote_java_tools/java_tools/Runner_deploy.jar)
    WARNING: Please consider reporting this to the maintainers of com.google.testing.junit.runner.junit4.JUnit4Runner
    WARNING: System::setSecurityManager will be removed in a future release
    .SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
    Pact files will be written to: /private/var/tmp/_bazel_imrankhan/b141c088e4409f9b6c4d0f13116258fa/sandbox/darwin-sandbox/28/execroot/harness_monorepo/bazel-out/darwin_arm64-fastbuild/bin/access-control/contracts/openapi/v1/AccessControlConsumerPactTest.runfiles/harness_monorepo/pacts
    .Pact files will be written to: /private/var/tmp/_bazel_imrankhan/b141c088e4409f9b6c4d0f13116258fa/sandbox/darwin-sandbox/28/execroot/harness_monorepo/bazel-out/darwin_arm64-fastbuild/bin/access-control/contracts/openapi/v1/AccessControlConsumerPactTest.runfiles/harness_monorepo/pacts
    .Pact files will be written to: /private/var/tmp/_bazel_imrankhan/b141c088e4409f9b6c4d0f13116258fa/sandbox/darwin-sandbox/28/execroot/harness_monorepo/bazel-out/darwin_arm64-fastbuild/bin/access-control/contracts/openapi/v1/AccessControlConsumerPactTest.runfiles/harness_monorepo/pacts
    <http://localhost:60308/users/123>
    
    Time: 0.957
    
    OK (3 tests)
    
    WARNING: A terminally deprecated method in java.lang.System has been called
    WARNING: System::setSecurityManager has been called by com.google.testing.junit.runner.util.GoogleTestSecurityManager (file:/private/var/tmp/_bazel_imrankhan/b141c088e4409f9b6c4d0f13116258fa/external/remote_java_tools/java_tools/Runner_deploy.jar)
    WARNING: Please consider reporting this to the maintainers of com.google.testing.junit.runner.util.GoogleTestSecurityManager
    WARNING: System::setSecurityManager will be removed in a future release
    
    BazelTestRunner exiting with a return value of 0
    JVM shutdown hooks (if any) will run now.
    The JVM will exit once they complete.
    
    -- JVM shutdown starting at 2025-06-16 11:40:14 --
    
    ================================================================================
    Target //access-control/contracts/openapi/v1:AccessControlConsumerPactTest up-to-date:
      /private/var/tmp/_bazel_imrankhan/b141c088e4409f9b6c4d0f13116258fa/execroot/harness_monorepo/bazel-out/darwin_arm64-fastbuild/bin/access-control/contracts/openapi/v1/AccessControlConsumerPactTest.jar
      /private/var/tmp/_bazel_imrankhan/b141c088e4409f9b6c4d0f13116258fa/execroot/harness_monorepo/bazel-out/darwin_arm64-fastbuild/bin/access-control/contracts/openapi/v1/AccessControlConsumerPactTest
    INFO: Elapsed time: 3.016s, Critical Path: 2.82s
    INFO: 2 processes: 1 internal, 1 darwin-sandbox.
    INFO: Build completed successfully, 2 total actions
    //access-control/contracts/openapi/v1:AccessControlConsumerPactTest      PASSED in 2.7s
    
    Executed 1 out of 1 test: 1 test passes.
    y
    • 2
    • 3