https://pact.io logo
#pact-jvm
Title
# pact-jvm
t

Thomas K

03/01/2022, 10:40 PM
Hello, is it possible to set loose expectations on a range of status code like 2xx ? I stumbled across https://github.com/pact-foundation/pact-specification/issues/68 but it wasn't overly clear if this is possible now or not ?
u

uglyog

03/01/2022, 11:02 PM
This has been implemented as part of the V4 spec changes in v4.3.x. The DSL now has methods like
successStatus()
which will match all status codes from 200-299
t

Thomas K

03/01/2022, 11:17 PM
Perfect that's exactly what I needed. Thank you :)
@uglyog sorry just to follow up on this, if the provider side (e.g. pact go) is stuck using v2 spec, is there anything i can do for this or am i forced to specify just one specific status code and i assume id be having to use v2 spec on consumer side (jvm) too?
u

uglyog

03/10/2022, 8:59 PM
No, sorry, the V2 implementations don't have anything like this
t

Thomas K

03/10/2022, 9:14 PM
ok thanks, what about v3 spec?
u

uglyog

03/10/2022, 9:16 PM
No, it was added in V4
But anything that supports V3 should also have V4 support
t

Thomas K

03/10/2022, 9:18 PM
hm ok, unfortunately the person helping me on pact go provider side is on m1 mac and having issues getting up and running with v3 spec so i think we might have to use v2 spec
thanks for the info
3 Views