2626import static com .github .tomakehurst .wiremock .client .WireMock .postRequestedFor ;
2727import static com .github .tomakehurst .wiremock .client .WireMock .put ;
2828import static com .github .tomakehurst .wiremock .client .WireMock .putRequestedFor ;
29- import static com .github .tomakehurst .wiremock .client .WireMock .urlEqualTo ;
3029import static com .github .tomakehurst .wiremock .client .WireMock .urlPathEqualTo ;
3130import static com .github .tomakehurst .wiremock .core .WireMockConfiguration .wireMockConfig ;
3231import static org .assertj .core .api .Assertions .assertThat ;
@@ -87,7 +86,7 @@ void setup() {
8786 void deleteNamespacedPodReturningStatus () {
8887 V1Status status = new V1Status ().kind ("Status" ).code (200 ).message ("good!" );
8988 apiServer .stubFor (
90- delete (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
89+ delete (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
9190 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (status ))));
9291
9392 KubernetesApiResponse <V1Pod > deletePodResp = podClient .delete ("default" , "foo1" , null );
@@ -101,7 +100,7 @@ void deleteNamespacedPodReturningStatus() {
101100 void deleteNamespacedPodAsyncReturningStatus () throws InterruptedException {
102101 V1Status status = new V1Status ().kind ("Status" ).code (200 ).message ("good!" );
103102 apiServer .stubFor (
104- delete (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
103+ delete (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
105104 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (status ))));
106105 TestCallback <V1Pod > callback = new TestCallback <>(podClient .getApiClient ());
107106
@@ -123,7 +122,7 @@ void deleteNamespacedPodReturningDeletedObject() {
123122 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
124123
125124 apiServer .stubFor (
126- delete (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
125+ delete (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
127126 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
128127
129128 KubernetesApiResponse <V1Pod > deletePodResp = podClient .delete ("default" , "foo1" );
@@ -139,7 +138,7 @@ void deleteNamespacedPodAsyncReturningDeletedObject() throws InterruptedExceptio
139138 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
140139
141140 apiServer .stubFor (
142- delete (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
141+ delete (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
143142 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
144143 TestCallback <V1Pod > callback = new TestCallback <>(podClient .getApiClient ());
145144
@@ -159,7 +158,7 @@ void deleteNamespacedPodReturningForbiddenStatus() {
159158 V1Status status = new V1Status ().kind ("Status" ).code (403 ).message ("good!" );
160159
161160 apiServer .stubFor (
162- delete (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
161+ delete (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
163162 .willReturn (aResponse ().withStatus (403 ).withBody (json .serialize (status ))));
164163
165164 KubernetesApiResponse <V1Pod > deletePodResp = podClient .delete ("default" , "foo1" );
@@ -174,7 +173,7 @@ void deleteNamespacedPodAsyncReturningForbiddenStatus() throws InterruptedExcept
174173 V1Status status = new V1Status ().kind ("Status" ).code (403 ).message ("good!" );
175174
176175 apiServer .stubFor (
177- delete (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
176+ delete (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
178177 .willReturn (aResponse ().withStatus (403 ).withBody (json .serialize (status ))));
179178 TestCallback <V1Pod > callback = new TestCallback <>(podClient .getApiClient ());
180179
@@ -316,7 +315,7 @@ void createNamespacedPodReturningObject() {
316315 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
317316
318317 apiServer .stubFor (
319- post (urlEqualTo ("/api/v1/namespaces/default/pods" ))
318+ post (urlPathEqualTo ("/api/v1/namespaces/default/pods" ))
320319 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
321320 KubernetesApiResponse <V1Pod > podListResp = podClient .create (foo1 );
322321 assertThat (podListResp .isSuccess ()).isTrue ();
@@ -331,7 +330,7 @@ void createNamespacedPodAsyncReturningObject() throws InterruptedException {
331330 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
332331
333332 apiServer .stubFor (
334- post (urlEqualTo ("/api/v1/namespaces/default/pods" ))
333+ post (urlPathEqualTo ("/api/v1/namespaces/default/pods" ))
335334 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
336335 TestCallback <V1Pod > callback = new TestCallback <>(podClient .getApiClient ());
337336
@@ -351,7 +350,7 @@ void updateNamespacedPodReturningObject() {
351350 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
352351
353352 apiServer .stubFor (
354- put (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
353+ put (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
355354 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
356355 KubernetesApiResponse <V1Pod > podListResp = podClient .update (foo1 );
357356 assertThat (podListResp .isSuccess ()).isTrue ();
@@ -366,7 +365,7 @@ void updateNamespacedPodAsyncReturningObject() throws InterruptedException {
366365 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
367366
368367 apiServer .stubFor (
369- put (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
368+ put (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
370369 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
371370 TestCallback <V1Pod > callback = new TestCallback <>(podClient .getApiClient ());
372371
@@ -386,7 +385,7 @@ void patchNamespacedPodReturningObject() {
386385 V1Pod foo1 =
387386 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
388387 apiServer .stubFor (
389- patch (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
388+ patch (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
390389 .withHeader ("Content-Type" , containing (V1Patch .PATCH_FORMAT_STRATEGIC_MERGE_PATCH ))
391390 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
392391 KubernetesApiResponse <V1Pod > podPatchResp =
@@ -404,7 +403,7 @@ void patchNamespacedPodAsyncReturningObject() throws InterruptedException {
404403 V1Pod foo1 =
405404 new V1Pod ().kind ("Pod" ).metadata (new V1ObjectMeta ().namespace ("default" ).name ("foo1" ));
406405 apiServer .stubFor (
407- patch (urlEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
406+ patch (urlPathEqualTo ("/api/v1/namespaces/default/pods/foo1" ))
408407 .withHeader ("Content-Type" , containing (V1Patch .PATCH_FORMAT_STRATEGIC_MERGE_PATCH ))
409408 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
410409 TestCallback <V1Pod > callback = new TestCallback <>(podClient .getApiClient ());
@@ -430,7 +429,7 @@ void patchNamespacedPodWithApiPrefix() {
430429 // add api prefix
431430 String prefix = "/k8s/clusters/c-7q988" ;
432431 apiServer .stubFor (
433- patch (urlEqualTo (prefix + "/api/v1/namespaces/default/pods/foo1" ))
432+ patch (urlPathEqualTo (prefix + "/api/v1/namespaces/default/pods/foo1" ))
434433 .withHeader ("Content-Type" , containing (V1Patch .PATCH_FORMAT_STRATEGIC_MERGE_PATCH ))
435434 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
436435
@@ -462,7 +461,7 @@ void patchNamespacedPodAsyncWithApiPrefix() throws InterruptedException {
462461 // add api prefix
463462 String prefix = "/k8s/clusters/c-7q988" ;
464463 apiServer .stubFor (
465- patch (urlEqualTo (prefix + "/api/v1/namespaces/default/pods/foo1" ))
464+ patch (urlPathEqualTo (prefix + "/api/v1/namespaces/default/pods/foo1" ))
466465 .withHeader ("Content-Type" , containing (V1Patch .PATCH_FORMAT_STRATEGIC_MERGE_PATCH ))
467466 .willReturn (aResponse ().withStatus (200 ).withBody (json .serialize (foo1 ))));
468467 TestCallback <V1Pod > callback = new TestCallback <>(podClient .getApiClient ());
@@ -501,7 +500,7 @@ void readTimeoutShouldThrowException() {
501500 .readTimeout (1 , TimeUnit .MILLISECONDS ) // timeout everytime
502501 .build ());
503502 apiServer .stubFor (
504- get (urlEqualTo ("/api/v1/namespaces/foo/pods/test" ))
503+ get (urlPathEqualTo ("/api/v1/namespaces/foo/pods/test" ))
505504 .willReturn (aResponse ().withFixedDelay (99999 ).withStatus (200 ).withBody ("" )));
506505 podClient =
507506 new GenericKubernetesApi <>(V1Pod .class , V1PodList .class , "" , "v1" , "pods" , apiClient );
0 commit comments