https://linen.dev logo
Title
y

Yash Agarwal

03/14/2023, 9:56 AM
i am setting up a new project. Using
"org.springframework.cloud:spring-cloud-starter-contract-stub-runner"
But I am getting the following error and not sure why. Any help ?
Request was not matched
                                               =======================

-----------------------------------------------------------------------------------------------------------------------
| Closest stub                                             | Request                                                  |
-----------------------------------------------------------------------------------------------------------------------
                                                           |
GET                                                        | GET
/ldap_directory_items/v2/group_members?key=key&name=APP-O  | /ldap_directory_items/v2/group_members?key=key&name=APP-O
AUTH2-ABCD&size=100000                                     | AUTH2-ABCD&size=100000
                                                           |
                                                           |
-----------------------------------------------------------------------------------------------------------------------
t

Tom

03/14/2023, 11:00 AM
Hi @Yash Agarwal what type of URL match does that stub have? Might be that you’re attempting to match a URL with a query string using a path only matcher.
y

Yash Agarwal

03/14/2023, 11:25 AM
urlEqualTo. I tried Path and Regex. None are working.
-----------------------------------------------------------------------------------------------------------------------
| Closest stub                                             | Request                                                  |
-----------------------------------------------------------------------------------------------------------------------
                                                           |
GET                                                        | GET
[path] /ldap_directory_items/v2/group_members              | /ldap_directory_items/v2/group_members?key=key&name=APP-O
                                                           | AUTH2-ABCD&size=100000
                                                           |
Query: key = key                                           | key: key
Query: name = APP-OAUTH2-ABCD                              | name: APP-OAUTH2-ABCD
Query: size = 100000                                       | size: 100000
                                                           |
                                                           |
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
| Closest stub                                             | Request                                                  |
-----------------------------------------------------------------------------------------------------------------------
                                                           |
GET                                                        | GET
[regex] /ldap_directory_items/v2/group_members.*           | /ldap_directory_items/v2/group_members?key=key&name=APP-O
                                                           | AUTH2-ABCD&size=100000
                                                           |
                                                           |
-----------------------------------------------------------------------------------------------------------------------
t

Tom

03/14/2023, 11:28 AM
Are you using the latest version of WireMock i.e. 2.35.0?
y

Yash Agarwal

03/14/2023, 5:06 PM
yes.
t

Tom

03/14/2023, 5:12 PM
In that case can you share the full stub definition JSON and the request you’re making?