Skip to content

Gradle provider verification from pact file #1587

@coco1979ka

Description

@coco1979ka

Hi,

I'm currently struggling with setting up a provider verification with the gradle plugin. My configuration in build.gradle.kts looks like this:

pact {
    serviceProviders {
        create("my-provider") {
            verificationType = au.com.dius.pact.provider.PactVerification.ANNOTATED_METHOD
            packagesToScan = listOf("bar.foo.backend")

            hasPactWith("my-consumer", closureOf<GradleConsumerInfo>{
                pactSource = file("path/to/my/pactfile")
            } as Closure<GradleConsumerInfo>)
        }
    }
}

When I try to run the task pactVerify it throws an error: Cannot invoke "au.com.dius.pact.provider.gradle.Broker.getPactBrokerUsername()" because the return value of "au.com.dius.pact.provider.gradle.PactPluginExtension.getBroker()" is null

Same happens when I do the same configuration with grade DSL. I wonder why the broker object is required to be present, if I'm using hasPactWith and providing a file path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions