Add to TimeSourceTests
This commit is contained in:
@@ -16,13 +16,18 @@
|
||||
|
||||
package org.springframework.cloud.stream.apps.integration.test.source.time;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
|
||||
import org.springframework.cloud.stream.app.test.integration.StreamAppContainer;
|
||||
import org.springframework.cloud.stream.app.test.integration.StreamAppContainerTestUtils;
|
||||
import org.springframework.cloud.stream.app.test.integration.junit.jupiter.KafkaStreamAppTest;
|
||||
import org.springframework.cloud.stream.app.test.integration.kafka.KafkaStreamAppContainer;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.reactive.function.client.ClientResponse;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.cloud.stream.apps.integration.test.common.Configuration.VERSION;
|
||||
|
||||
@KafkaStreamAppTest
|
||||
@@ -30,5 +35,20 @@ class KafkaTimeSourceTests extends TimeSourceTests {
|
||||
|
||||
@Container
|
||||
static StreamAppContainer source = new KafkaStreamAppContainer(StreamAppContainerTestUtils
|
||||
.imageName(StreamAppContainerTestUtils.SPRINGCLOUDSTREAM_REPOSITOTRY, "time-source-kafka", VERSION));
|
||||
.imageName(StreamAppContainerTestUtils.SPRINGCLOUDSTREAM_REPOSITOTRY, "time-source-kafka", VERSION))
|
||||
.withCommand("--server.port", "8080")
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@Test
|
||||
void testActuator() {
|
||||
WebClient webClient = WebClient.create();
|
||||
ClientResponse response = webClient.get()
|
||||
.uri("http://localhost:" + source.getMappedPort(8080) + "/actuator/health").exchange().block();
|
||||
assertThat(response.statusCode()).isEqualTo(HttpStatus.OK);
|
||||
response = webClient.get().uri("http://localhost:" + source.getMappedPort(8080) + "/actuator/info").exchange()
|
||||
.block();
|
||||
assertThat(response.statusCode()).isEqualTo(HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user