Skip to content

Commit

Permalink
Support Spring boot 3.2 (#1632)
Browse files Browse the repository at this point in the history
* chore(deps): Bump org.springframework.boot:spring-boot-dependencies

Bumps [org.springframework.boot:spring-boot-dependencies](https://github.com/spring-projects/spring-boot) from 3.1.5 to 3.2.0.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.1.5...v3.2.0)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-dependencies
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix renovate
* fix compatibility with Spring Boot 3.2
* Fixed kaycloak double startup with different version
* Fixed dependency for JcaPEMKeyConverter for KubernetesClient
* Fixed dependency for git and bouncycastle
* Fixed dependency for Spring Cloud 2023.0
* Update doc with Versions compatibility and Spring Boot 3.2 and Spring Cloud 2023.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: admitrov <[email protected]>
Co-authored-by: Igor Yova <[email protected]>
Co-authored-by: Igor Yova <[email protected]>
  • Loading branch information
4 people authored Dec 8, 2023
1 parent ad4ec08 commit 65a0fcd
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Usage of Spring Cloud in your production code is optional, but __you will need i
|2.4.X, 2.5.X, 2.6.X, 2.7.X
|2.X.X

|3.0.X, 3.1.X
|2.7.X, 3.0.X, 3.1.X
|3.0.X

|3.2.X
|WIP
|3.1.X
|===

[[how-to-use]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.playtika.testcontainer.couchbase;

import com.couchbase.client.core.env.SeedNode;
import com.couchbase.client.core.env.TimeoutConfig;
import com.couchbase.client.core.retry.BestEffortRetryStrategy;
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.Cluster;
Expand Down Expand Up @@ -55,7 +54,7 @@ void plainJavaClientShouldWork() {
ClusterEnvironment env = ClusterEnvironment.builder()
.retryStrategy(BestEffortRetryStrategy.withExponentialBackoff(Duration.ofMillis(50), Duration.ofMillis(500), 2))
.maxNumRequestsInRetry(5)
.timeoutConfig(TimeoutConfig.kvTimeout(Duration.ofSeconds(20)))
.timeoutConfig(timeout -> timeout.kvTimeout(Duration.ofSeconds(20)))
.build();

ClusterOptions options = ClusterOptions
Expand Down
6 changes: 6 additions & 0 deletions embedded-git/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
<artifactId>embedded-git</artifactId>

<properties>
<bcpkix-jdk18on.version>1.75</bcpkix-jdk18on.version>
</properties>

<dependencies>
<dependency>
<groupId>com.playtika.testcontainers</groupId>
<artifactId>testcontainers-common</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bcpkix-jdk18on.version}</version>
</dependency>
<dependency>
<groupId>com.playtika.testcontainers</groupId>
<artifactId>embedded-toxiproxy</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testPushViaSsh() {
writer.print("hello world!");
}
git.add().addFilepattern("test_file.txt").call();
git.commit().setMessage("Test commit").call();
git.commit().setMessage("Test commit").setSign(false).call();
git.push()
.setRemote("origin")
.setRefSpecs(new RefSpec(beforeRepoFolderName))
Expand Down
7 changes: 6 additions & 1 deletion embedded-k3s/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<artifactId>embedded-k3s</artifactId>

<properties>

<bcpkix-jdk18on.version>1.75</bcpkix-jdk18on.version>
</properties>

<dependencies>
Expand All @@ -31,6 +31,11 @@
<artifactId>k3s</artifactId>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bcpkix-jdk18on.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-client-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -23,13 +24,12 @@ public class SpringTestApplication {

@Bean
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http.authorizeHttpRequests()
.requestMatchers("/api/**").fullyAuthenticated()
.and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().oauth2ResourceServer(oauth2 -> oauth2.jwt().jwtAuthenticationConverter(new KeycloakJwtAuthenticationConverter(client)))
.formLogin().disable()
.httpBasic().disable()
.build();
return http.authorizeHttpRequests(requests -> requests.requestMatchers("/api/**").fullyAuthenticated())
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.oauth2ResourceServer(oauth2 -> oauth2.jwt(jwt -> jwt.jwtAuthenticationConverter(new KeycloakJwtAuthenticationConverter(client))))
.formLogin(AbstractHttpConfigurer::disable)
.httpBasic(AbstractHttpConfigurer::disable)
.build();
}

@RolesAllowed("role_reader")
Expand Down
1 change: 0 additions & 1 deletion embedded-keycloak/src/test/resources/bootstrap-enabled.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
embedded:
keycloak:
enabled: true
docker-image: 'quay.io/keycloak/keycloak:21.0.0'
wait-timeout-in-seconds: 60
command: "start-dev --import-realm"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.testcontainers.containers.ContainerLaunchException;
import redis.clients.jedis.Jedis;

import java.util.List;
import java.util.Map;

@Slf4j
@RequiredArgsConstructor
Expand Down Expand Up @@ -37,14 +37,14 @@ private void logClusterInfo() {
try (Jedis jedis = createJedis()) {
String clusterInfo = jedis.clusterInfo();
String info = jedis.info();
List<String> config = jedis.configGet("*");
Map<String, String> config = jedis.configGet("*");
String clusterNodes = jedis.clusterNodes();
log.error("Cluster in failed state:\n" +
"-- cluster info:\n{}\n" +
"-- nodes:\n{}\n" +
"-- info:\n{}\n" +
"-- config:\n{}",
clusterInfo, clusterNodes, info, String.join("\n", config));
clusterInfo, clusterNodes, info, String.join("\n", config.values()));
}
}

Expand Down
9 changes: 7 additions & 2 deletions embedded-opensearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

<artifactId>embedded-opensearch</artifactId>

<properties>
<spring-data-opensearch-starter.version>1.3.0</spring-data-opensearch-starter.version>
<opensearch-testcontainers.version>2.0.1</opensearch-testcontainers.version>
</properties>

<dependencies>
<dependency>
<groupId>com.playtika.testcontainers</groupId>
Expand All @@ -24,12 +29,12 @@
<dependency>
<groupId>org.opensearch</groupId>
<artifactId>opensearch-testcontainers</artifactId>
<version>2.0.1</version>
<version>${opensearch-testcontainers.version}</version>
</dependency>
<dependency>
<groupId>org.opensearch.client</groupId>
<artifactId>spring-data-opensearch-starter</artifactId>
<version>1.2.1</version>
<version>${spring-data-opensearch-starter.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.testcontainers.containers.ContainerLaunchException;
import redis.clients.jedis.Jedis;

import java.util.List;
import java.util.Map;

@Slf4j
@RequiredArgsConstructor
Expand Down Expand Up @@ -37,14 +37,14 @@ private void logClusterInfo() {
try (Jedis jedis = createJedis()) {
String clusterInfo = jedis.clusterInfo();
String info = jedis.info();
List<String> config = jedis.configGet("*");
Map<String, String> config = jedis.configGet("*");
String clusterNodes = jedis.clusterNodes();
log.error("Cluster in failed state:\n" +
"-- cluster info:\n{}\n" +
"-- nodes:\n{}\n" +
"-- info:\n{}\n" +
"-- config:\n{}",
clusterInfo, clusterNodes, info, String.join("\n", config));
clusterInfo, clusterNodes, info, String.join("\n", config.values()));
}
}

Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
</profile>
</profiles>


<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand All @@ -191,7 +190,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<parameters>true</parameters>
<parameters>true</parameters>
</configuration>
</plugin>
<plugin>
Expand Down
4 changes: 2 additions & 2 deletions testcontainers-spring-boot-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<properties>
<testcontainers.version>1.19.3</testcontainers.version>
<spring.boot.version>3.1.5</spring.boot.version>
<spring.cloud.version>2022.0.4</spring.cloud.version>
<spring.boot.version>3.2.0</spring.boot.version>
<spring.cloud.version>2023.0.0</spring.cloud.version>
<spring.cloud.gcp.version>4.8.4</spring.cloud.gcp.version>
<equalsverifier.version>3.15.4</equalsverifier.version>
<junit-jupiter.version>5.10.1</junit-jupiter.version>
Expand Down

0 comments on commit 65a0fcd

Please sign in to comment.