pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.07k stars 473 forks source link

From version 4.3.+ using numberType in Java cannot compile #1802

Open koww opened 2 weeks ago

koww commented 2 weeks ago

Hello,

I am updating an existing contract test code and when updating the version from 4.2.0 to 4.3.0, an existing line starts to throw exception:

.numberType("some", "of", "my", "old", "test", "fields")
  ^
  required: String,Number[]
  found:    String,String,String,String,String,String)

And it's also there with 4.3.19 I'm using Gradle 7.4.2 and Java 17.


plugins {
    id "au.com.dius.pact" version "4.3.0"
}

dependencies {
    ...
    testImplementation("au.com.dius.pact.consumer:junit5:4.3.0")
}

Any insights would be appreciated. 
Thank you. 
rholshausen commented 1 week ago

You might need to cast it. There are 3 versions, and your compiler is having trouble picking the correct one.