Skip to content

Commit 4726803

Browse files
committed
use urlPathMatching instead
1 parent c00f939 commit 4726803

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

util/src/test/java/io/kubernetes/client/MetricsTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ public void getPodMetricsThrowsAPIExceptionWhenServerReturnsError() {
4242
String namespace = "default";
4343
Metrics metrics = new Metrics(client);
4444
wireMockRule.stubFor(
45-
get(urlEqualTo(
46-
"/apis/metrics.k8s.io/v1beta1/namespaces/" + namespace + "/pods?watch=false"))
45+
get(urlPathMatching("^/apis/metrics.k8s.io/v1beta1/namespaces/" + namespace + "/pods.*"))
4746
.willReturn(
4847
aResponse()
4948
.withStatus(503)
@@ -61,7 +60,7 @@ public void getPodMetricsThrowsAPIExceptionWhenServerReturnsError() {
6160
public void getNodeMetricsThrowsAPIExceptionWhenServerReturnsError() {
6261
Metrics metrics = new Metrics(client);
6362
wireMockRule.stubFor(
64-
get(urlEqualTo("/apis/metrics.k8s.io/v1beta1/nodes?watch=false"))
63+
get(urlPathMatching("^/apis/metrics.k8s.io/v1beta1/nodes.*"))
6564
.willReturn(
6665
aResponse()
6766
.withStatus(503)

0 commit comments

Comments
 (0)