mirror of https://github.com/dapr/java-sdk.git
Upgrading spring boot version to 3.4.3 (#1220)
* upgrading spring boot version to 3.4.3 Signed-off-by: salaboy <Salaboy@gmail.com> * removing sb 3.2.x Signed-off-by: salaboy <Salaboy@gmail.com> * fixing label Signed-off-by: salaboy <Salaboy@gmail.com> * using 3.3.9 to validate against sb 3.3.x Signed-off-by: salaboy <Salaboy@gmail.com> * found the issue with the version Signed-off-by: salaboy <Salaboy@gmail.com> * removing toxic dep from classpath Signed-off-by: salaboy <Salaboy@gmail.com> * removing excludes Signed-off-by: salaboy <Salaboy@gmail.com> * upgrading otel and logback Signed-off-by: salaboy <Salaboy@gmail.com> * waiting for Dapr to be done with init Signed-off-by: salaboy <Salaboy@gmail.com> * waiting for placement Signed-off-by: salaboy <Salaboy@gmail.com> * using awaitability to wait for placement Signed-off-by: salaboy <Salaboy@gmail.com> * waiting for placement, but still flaky Signed-off-by: salaboy <Salaboy@gmail.com> * wait for app to be ready Signed-off-by: salaboy <Salaboy@gmail.com> * test with 1.14.4 Signed-off-by: salaboy <Salaboy@gmail.com> * Update DaprContainerIT.java Signed-off-by: Artur Souza <asouza.pro@gmail.com> --------- Signed-off-by: salaboy <Salaboy@gmail.com> Signed-off-by: Artur Souza <asouza.pro@gmail.com> Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com> Co-authored-by: Cassie Coyle <cassie@diagrid.io> Co-authored-by: Artur Souza <asouza.pro@gmail.com> Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
This commit is contained in:
parent
efce229985
commit
36a0140398
|
@ -24,12 +24,12 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
java: [ 17 ]
|
java: [ 17 ]
|
||||||
spring-boot-version: [ 3.2.6 ]
|
spring-boot-version: [ 3.4.3 ]
|
||||||
spring-boot-display-version: [ 3.2.x ]
|
spring-boot-display-version: [ 3.4.x ]
|
||||||
experimental: [ false ]
|
experimental: [ false ]
|
||||||
include:
|
include:
|
||||||
- java: 17
|
- java: 17
|
||||||
spring-boot-version: 3.3.0
|
spring-boot-version: 3.3.9
|
||||||
spring-boot-display-version: 3.3.x
|
spring-boot-display-version: 3.3.x
|
||||||
experimental: false
|
experimental: false
|
||||||
env:
|
env:
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -45,7 +45,7 @@
|
||||||
<junit-bom.version>5.8.2</junit-bom.version>
|
<junit-bom.version>5.8.2</junit-bom.version>
|
||||||
<snakeyaml.version>2.0</snakeyaml.version>
|
<snakeyaml.version>2.0</snakeyaml.version>
|
||||||
<testcontainers.version>1.20.0</testcontainers.version>
|
<testcontainers.version>1.20.0</testcontainers.version>
|
||||||
<springboot.version>3.2.6</springboot.version>
|
<springboot.version>3.4.3</springboot.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
|
|
|
@ -28,9 +28,9 @@
|
||||||
<protobuf.input.directory>${project.basedir}/proto</protobuf.input.directory>
|
<protobuf.input.directory>${project.basedir}/proto</protobuf.input.directory>
|
||||||
<grpc.version>1.69.0</grpc.version>
|
<grpc.version>1.69.0</grpc.version>
|
||||||
<protobuf.version>3.25.5</protobuf.version>
|
<protobuf.version>3.25.5</protobuf.version>
|
||||||
<opentelemetry.version>1.39.0</opentelemetry.version>
|
<opentelemetry.version>1.41.0</opentelemetry.version>
|
||||||
<springboot.version>3.3.1</springboot.version>
|
<springboot.version>3.4.3</springboot.version>
|
||||||
<logback-classic.version>1.4.12</logback-classic.version>
|
<logback-core.version>1.5.16</logback-core.version>
|
||||||
<wiremock.version>3.9.1</wiremock.version>
|
<wiremock.version>3.9.1</wiremock.version>
|
||||||
<testcontainers-test.version>1.20.0</testcontainers-test.version>
|
<testcontainers-test.version>1.20.0</testcontainers-test.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -49,11 +49,6 @@
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-cli</groupId>
|
|
||||||
<artifactId>commons-cli</artifactId>
|
|
||||||
<version>1.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.grpc</groupId>
|
<groupId>io.grpc</groupId>
|
||||||
<artifactId>grpc-protobuf</artifactId>
|
<artifactId>grpc-protobuf</artifactId>
|
||||||
|
@ -70,14 +65,9 @@
|
||||||
<version>${grpc.version}</version>
|
<version>${grpc.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.protobuf</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>protobuf-java-util</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>${protobuf.version}</version>
|
<version>2.14.0</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.os72</groupId>
|
|
||||||
<artifactId>protoc-jar-maven-plugin</artifactId>
|
|
||||||
<version>3.11.4</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.opentelemetry</groupId>
|
<groupId>io.opentelemetry</groupId>
|
||||||
|
@ -178,32 +168,20 @@
|
||||||
<groupId>org.springframework.data</groupId>
|
<groupId>org.springframework.data</groupId>
|
||||||
<artifactId>spring-data-keyvalue</artifactId>
|
<artifactId>spring-data-keyvalue</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wiremock</groupId>
|
<groupId>org.wiremock</groupId>
|
||||||
<artifactId>wiremock-standalone</artifactId>
|
<artifactId>wiremock-standalone</artifactId>
|
||||||
<version>${wiremock.version}</version>
|
<version>${wiremock.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>ch.qos.logback</groupId>
|
|
||||||
<artifactId>logback-classic</artifactId>
|
|
||||||
<version>${logback-classic.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.projectreactor</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>reactor-core</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<version>3.6.7</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -212,6 +190,12 @@
|
||||||
<version>3.9</version>
|
<version>3.9</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-core</artifactId>
|
||||||
|
<version>${logback-core.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.testcontainers</groupId>
|
<groupId>org.testcontainers</groupId>
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
|
|
|
@ -21,14 +21,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class TestApplication {
|
public class TestApplication {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts Dapr's callback in a given port.
|
* Starts Dapr's callback in a given port.
|
||||||
* @param port Port to listen to.
|
* @param port Port to listen to.
|
||||||
*/
|
*/
|
||||||
public static void start(long port) {
|
public static void start(long port) {
|
||||||
SpringApplication app = new SpringApplication(TestApplication.class);
|
SpringApplication.run(TestApplication.class, String.format("--server.port=%d", port));
|
||||||
app.run(String.format("--server.port=%d", port));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,11 +27,15 @@ import okhttp3.Response;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Tag;
|
import org.junit.jupiter.api.Tag;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.testcontainers.containers.wait.strategy.Wait;
|
||||||
import org.testcontainers.junit.jupiter.Container;
|
import org.testcontainers.junit.jupiter.Container;
|
||||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||||
|
import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
|
||||||
|
import org.testcontainers.shaded.org.awaitility.core.ConditionTimeoutException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
|
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
|
||||||
import static com.github.tomakehurst.wiremock.client.WireMock.any;
|
import static com.github.tomakehurst.wiremock.client.WireMock.any;
|
||||||
|
@ -48,6 +52,8 @@ import static io.dapr.it.testcontainers.DaprContainerConstants.IMAGE_TAG;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
|
|
||||||
@Testcontainers
|
@Testcontainers
|
||||||
@WireMockTest(httpPort = 8081)
|
@WireMockTest(httpPort = 8081)
|
||||||
|
@ -60,6 +66,7 @@ public class DaprContainerIT {
|
||||||
private static final String KEY = "my-key";
|
private static final String KEY = "my-key";
|
||||||
private static final String PUBSUB_NAME = "pubsub";
|
private static final String PUBSUB_NAME = "pubsub";
|
||||||
private static final String PUBSUB_TOPIC_NAME = "topic";
|
private static final String PUBSUB_TOPIC_NAME = "topic";
|
||||||
|
private static final String APP_FOUND_MESSAGE_PATTERN = ".*application discovered on port 8081.*";
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(IMAGE_TAG)
|
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(IMAGE_TAG)
|
||||||
|
@ -129,9 +136,26 @@ public class DaprContainerIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPlacement() throws Exception {
|
public void testPlacement() throws Exception {
|
||||||
// Dapr and Placement need some time to connect
|
Wait.forLogMessage(APP_FOUND_MESSAGE_PATTERN, 1).waitUntilReady(DAPR_CONTAINER);
|
||||||
Thread.sleep(1000);
|
try {
|
||||||
|
await().atMost(10, TimeUnit.SECONDS)
|
||||||
|
.pollDelay(500, TimeUnit.MILLISECONDS)
|
||||||
|
.pollInterval(500, TimeUnit.MILLISECONDS)
|
||||||
|
.until(() -> {
|
||||||
|
String metadata = checkSidecarMetadata();
|
||||||
|
if (metadata.contains("placement: connected")) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (ConditionTimeoutException timeoutException) {
|
||||||
|
fail("The placement server is not connected");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String checkSidecarMetadata() throws IOException {
|
||||||
OkHttpClient okHttpClient = new OkHttpClient.Builder()
|
OkHttpClient okHttpClient = new OkHttpClient.Builder()
|
||||||
.build();
|
.build();
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
|
@ -140,7 +164,7 @@ public class DaprContainerIT {
|
||||||
|
|
||||||
try (Response response = okHttpClient.newCall(request).execute()) {
|
try (Response response = okHttpClient.newCall(request).execute()) {
|
||||||
if (response.isSuccessful() && response.body() != null) {
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
assertTrue(response.body().string().contains("placement: connected"));
|
return response.body().string();
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Unexpected response: " + response.code());
|
throw new IOException("Unexpected response: " + response.code());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue