Skip to content

Commit 2fb3b02

Browse files
author
Shubh Bapna
committed
formatted tests
1 parent 6683005 commit 2fb3b02

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

extended/src/test/java/io/kubernetes/client/extended/kubectl/KubectlLabelTest.java

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -82,29 +82,28 @@ public void testKubectlLabelNamespacedResourceShouldWork() throws KubectlExcepti
8282
@Test
8383
public void testKubectlDeleteLabelNamespacedResourceShouldWork() throws KubectlException {
8484
wireMockRule.stubFor(
85-
get(urlPathEqualTo("/api/v1/namespaces/default/pods/foo"))
86-
.willReturn(
87-
aResponse()
88-
.withStatus(200)
89-
.withBody("{\"metadata\":{\"name\":\"foo\",\"namespace\":\"default\"}}")));
85+
get(urlPathEqualTo("/api/v1/namespaces/default/pods/foo"))
86+
.willReturn(
87+
aResponse()
88+
.withStatus(200)
89+
.withBody("{\"metadata\":{\"name\":\"foo\",\"namespace\":\"default\"}}")));
9090
wireMockRule.stubFor(
91-
put(urlPathEqualTo("/api/v1/namespaces/default/pods/foo"))
92-
.withRequestBody(
93-
matchingJsonPath(
94-
"$.metadata.labels", equalToJson("{ \"k1\": \"null\" }")))
95-
.willReturn(
96-
aResponse()
97-
.withStatus(200)
98-
.withBody("{\"metadata\":{\"name\":\"foo\",\"namespace\":\"default\"}}")));
91+
put(urlPathEqualTo("/api/v1/namespaces/default/pods/foo"))
92+
.withRequestBody(
93+
matchingJsonPath("$.metadata.labels", equalToJson("{ \"k1\": \"null\" }")))
94+
.willReturn(
95+
aResponse()
96+
.withStatus(200)
97+
.withBody("{\"metadata\":{\"name\":\"foo\",\"namespace\":\"default\"}}")));
9998

10099
V1Pod unlabelledPod =
101-
Kubectl.label(V1Pod.class)
102-
.apiClient(apiClient)
103-
.skipDiscovery()
104-
.namespace("default")
105-
.name("foo")
106-
.deleteLabel("k1")
107-
.execute();
100+
Kubectl.label(V1Pod.class)
101+
.apiClient(apiClient)
102+
.skipDiscovery()
103+
.namespace("default")
104+
.name("foo")
105+
.deleteLabel("k1")
106+
.execute();
108107

109108
wireMockRule.verify(1, getRequestedFor(urlPathEqualTo("/api/v1/namespaces/default/pods/foo")));
110109
wireMockRule.verify(1, putRequestedFor(urlPathEqualTo("/api/v1/namespaces/default/pods/foo")));
@@ -169,28 +168,26 @@ public void testKubectlLabelClusterResourceShouldWork() throws KubectlException
169168
@Test
170169
public void testKubectlDeleteLabelClusterResourceShouldWork() throws KubectlException {
171170
wireMockRule.stubFor(
172-
get(urlPathEqualTo("/api/v1/nodes/foo"))
173-
.willReturn(aResponse().withStatus(200).withBody("{\"metadata\":{\"name\":\"foo\"}}")));
171+
get(urlPathEqualTo("/api/v1/nodes/foo"))
172+
.willReturn(aResponse().withStatus(200).withBody("{\"metadata\":{\"name\":\"foo\"}}")));
174173
wireMockRule.stubFor(
175-
put(urlPathEqualTo("/api/v1/nodes/foo"))
176-
.withRequestBody(
177-
matchingJsonPath(
178-
"$.metadata.labels", equalToJson("{ \"k1\": \"null\" }")))
179-
.willReturn(aResponse().withStatus(200).withBody("{\"metadata\":{\"name\":\"foo\"}}")));
174+
put(urlPathEqualTo("/api/v1/nodes/foo"))
175+
.withRequestBody(
176+
matchingJsonPath("$.metadata.labels", equalToJson("{ \"k1\": \"null\" }")))
177+
.willReturn(aResponse().withStatus(200).withBody("{\"metadata\":{\"name\":\"foo\"}}")));
180178

181179
V1Node unlabelledNode =
182-
Kubectl.label(V1Node.class)
183-
.apiClient(apiClient)
184-
.skipDiscovery()
185-
.name("foo")
186-
.deleteLabel("k1")
187-
.execute();
180+
Kubectl.label(V1Node.class)
181+
.apiClient(apiClient)
182+
.skipDiscovery()
183+
.name("foo")
184+
.deleteLabel("k1")
185+
.execute();
188186
wireMockRule.verify(1, getRequestedFor(urlPathEqualTo("/api/v1/nodes/foo")));
189187
wireMockRule.verify(1, putRequestedFor(urlPathEqualTo("/api/v1/nodes/foo")));
190188
assertNotNull(unlabelledNode);
191189
}
192190

193-
194191
@Test
195192
public void testKubectlLabelClusterResourceReceiveForbiddenShouldThrowException()
196193
throws KubectlException {

0 commit comments

Comments
 (0)