Skip to content

Commit 58ea298

Browse files
committed
remove un-used method
Signed-off-by: wind57 <[email protected]>
1 parent e3af38c commit 58ea298

File tree

1 file changed

+0
-50
lines changed
  • spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons

1 file changed

+0
-50
lines changed

spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons/Commons.java

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828
import java.util.List;
2929
import java.util.Objects;
3030
import java.util.Optional;
31-
import java.util.concurrent.TimeUnit;
3231

3332
import com.github.dockerjava.api.command.ListImagesCmd;
3433
import com.github.dockerjava.api.command.PullImageCmd;
3534
import com.github.dockerjava.api.command.SaveImageCmd;
3635
import com.github.dockerjava.api.model.Image;
3736
import org.apache.commons.logging.Log;
3837
import org.apache.commons.logging.LogFactory;
39-
import org.assertj.core.api.Assertions;
4038
import org.testcontainers.containers.Container;
4139
import org.testcontainers.k3s.K3sContainer;
4240
import reactor.netty.http.client.HttpClient;
@@ -79,54 +77,6 @@ public static void loadSpringCloudKubernetesImage(String project, K3sContainer c
7977
loadImage("springcloud/" + project, pomVersion(), project, container);
8078
}
8179

82-
/**
83-
* assert that "left" is present and if so, "right" is not.
84-
*/
85-
public static void assertReloadLogStatements(String left, String right, String appLabel) {
86-
87-
try {
88-
String appPodName = CONTAINER
89-
.execInContainer("sh", "-c",
90-
"kubectl get pods -l app=" + appLabel + " -o=name --no-headers | tr -d '\n'")
91-
.getStdout();
92-
LOG.info("appPodName : ->" + appPodName + "<-");
93-
// we issue a pollDelay to let the logs sync in, otherwise the results are not
94-
// going to be correctly asserted
95-
await().pollDelay(20, TimeUnit.SECONDS)
96-
.pollInterval(Duration.ofSeconds(5))
97-
.atMost(Duration.ofSeconds(120))
98-
.until(() -> {
99-
100-
Container.ExecResult result = CONTAINER.execInContainer("sh", "-c",
101-
"kubectl logs " + appPodName.trim() + "| grep " + "'" + left + "'");
102-
String error = result.getStderr();
103-
String ok = result.getStdout();
104-
105-
LOG.info("error is : -->" + error + "<--");
106-
107-
if (ok != null && !ok.isBlank()) {
108-
109-
if (!right.isBlank()) {
110-
String notPresent = CONTAINER
111-
.execInContainer("sh", "-c",
112-
"kubectl logs " + appPodName.trim() + "| grep " + "'" + right + "'")
113-
.getStdout();
114-
115-
Assertions.assertThat(notPresent).isNullOrEmpty();
116-
}
117-
118-
return true;
119-
}
120-
LOG.info("log statement not yet present");
121-
return false;
122-
});
123-
}
124-
catch (Exception e) {
125-
throw new RuntimeException(e);
126-
}
127-
128-
}
129-
13080
/**
13181
* create a tar, copy it in the running k3s and load this tar as an image.
13282
*/

0 commit comments

Comments
 (0)