Skip to content

Commit

Permalink
chore(deps): Bump org.springframework.boot from 3.1.5 to 3.2.0 (#481)
Browse files Browse the repository at this point in the history
* chore(deps): Bump org.springframework.boot from 3.1.5 to 3.2.0

Bumps [org.springframework.boot](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
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* chore: Add SSLBundle to required buildProperties method call

* chore: remove unused dependency com.vaadin.external.google:android-json

* test: Add application loggers to ApiSystemTest

* test(kafka): ensure ProducerSystemTest can connect to kafka

Without, the test connects to a kafka instance of a previous spring context instance - which is an embeddedkafka and not available

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Timon Back <[email protected]>
  • Loading branch information
dependabot[bot] and timonback authored Nov 24, 2023
1 parent dff3698 commit a3e3d40
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 74 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
plugins {
id 'ca.cutterslade.analyze' version '1.9.1'
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'org.springframework.boot' version '3.1.5' apply false
id 'org.springframework.boot' version '3.2.0' apply false
id 'org.owasp.dependencycheck' version '8.4.3'
id 'com.diffplug.spotless' version '6.22.0'
id 'com.bmuschko.docker-spring-boot-application' version '9.3.7' apply false
Expand Down
2 changes: 0 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* The dependencies are sorted alphabetically.
*/
ext {
androidJsonVersion = '0.0.20131108.vaadin1'

assertjCoreVersion = '3.24.2'

asyncapiCoreVersion = '1.0.0-EAP-2'
Expand Down
1 change: 0 additions & 1 deletion springwolf-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}")
testImplementation "org.assertj:assertj-core:${assertjCoreVersion}"
testImplementation "org.awaitility:awaitility:${awaitilityVersion}"
testImplementation "com.vaadin.external.google:android-json:${androidJsonVersion}"
testImplementation "org.mockito:mockito-core:${mockitoCoreVersion}"
testImplementation "org.springframework.boot:spring-boot-test"
testImplementation "org.springframework:spring-test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import lombok.Data;
import org.json.JSONException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -106,7 +105,7 @@ private AsyncAPI getAsyncAPITestObject() {
}

@Test
void AsyncAPI_should_map_to_a_valid_asyncapi_json() throws IOException, JSONException {
void AsyncAPI_should_map_to_a_valid_asyncapi_json() throws IOException {
var asyncapi = getAsyncAPITestObject();
String actual = serializer.toJsonString(asyncapi);
InputStream s = this.getClass().getResourceAsStream("/asyncapi/asyncapi.json");
Expand All @@ -115,7 +114,7 @@ void AsyncAPI_should_map_to_a_valid_asyncapi_json() throws IOException, JSONExce
}

@Test
void AsyncAPI_should_map_to_a_valid_asyncapi_yaml() throws IOException, JSONException {
void AsyncAPI_should_map_to_a_valid_asyncapi_yaml() throws IOException {
var asyncapi = getAsyncAPITestObject();
String actual = serializer.toYaml(asyncapi);
InputStream s = this.getClass().getResourceAsStream("/asyncapi/asyncapi.yaml");
Expand Down
5 changes: 3 additions & 2 deletions springwolf-examples/springwolf-amqp-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ dependencies {

testRuntimeOnly "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}"

testImplementation "com.vaadin.external.google:android-json:${androidJsonVersion}"

testImplementation "org.assertj:assertj-core:${assertjCoreVersion}"
testImplementation "org.awaitility:awaitility:${awaitilityVersion}"
testImplementation "org.mockito:mockito-core:${mockitoCoreVersion}"
Expand All @@ -42,6 +40,9 @@ dependencies {

testImplementation "org.testcontainers:testcontainers:${testcontainersVersion}"
testImplementation "org.testcontainers:junit-jupiter:${testcontainersVersion}"

testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
}

docker {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
package io.github.stavshamir.springwolf.example.amqp;

import org.json.JSONException;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.web.client.RestTemplate;
import org.testcontainers.containers.DockerComposeContainer;
Expand All @@ -23,6 +23,7 @@
* While the assertion of this test is identical to ApiIntegrationTests,
* the setup uses a full docker-compose context with a real kafka instance.
*/
@Slf4j
@Testcontainers
// @Ignore("Uncomment this line if you have issues running this test on your local machine.")
public class ApiSystemTest {
Expand All @@ -46,7 +47,8 @@ public class ApiSystemTest {
@Container
public static DockerComposeContainer<?> environment = new DockerComposeContainer<>(new File("docker-compose.yml"))
.withExposedService(APP_NAME, APP_PORT)
.withEnv(ENV);
.withEnv(ENV)
.withLogConsumer(APP_NAME, l -> log.debug("APP: %s".formatted(l.getUtf8StringWithoutLineEnding())));

private String baseUrl() {
String host = environment.getServiceHost(APP_NAME, APP_PORT);
Expand All @@ -55,7 +57,7 @@ private String baseUrl() {
}

@Test
void asyncapiDocsShouldReturnTheCorrectJsonResponse() throws IOException, JSONException {
void asyncapiDocsShouldReturnTheCorrectJsonResponse() throws IOException {
String url = baseUrl() + "/springwolf/docs";
String actual = restTemplate.getForObject(url, String.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}"

testImplementation "com.vaadin.external.google:android-json:${androidJsonVersion}"
testImplementation "org.assertj:assertj-core:${assertjCoreVersion}"
testImplementation "org.springframework.boot:spring-boot-test"
testImplementation "org.springframework:spring-test"
Expand All @@ -52,6 +51,9 @@ dependencies {
testImplementation "org.springframework.kafka:spring-kafka-test"
testImplementation "org.testcontainers:testcontainers:${testcontainersVersion}"
testImplementation "org.testcontainers:junit-jupiter:${testcontainersVersion}"

testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
}

docker {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
package io.github.stavshamir.springwolf.example.cloudstream;

import org.json.JSONException;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -21,28 +20,26 @@
@SpringBootTest(
classes = {SpringwolfCloudstreamExampleApplication.class},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@EmbeddedKafka(
partitions = 1,
brokerProperties = {"listeners=PLAINTEXT://localhost:29092", "port=29092"})
@EmbeddedKafka(partitions = 1)
@DirtiesContext
public class ApiIntegrationTest {

@Autowired
private TestRestTemplate restTemplate;

@Value("${server.port}")
public Integer serverPort;
@Value("${spring.kafka.bootstrap-servers}")
public String bootstrapServers;

@Test
void asyncApiResourceArtifactTest() throws JSONException, IOException {
void asyncApiResourceArtifactTest() throws IOException {
String url = "/springwolf/docs";
String actual = restTemplate.getForObject(url, String.class);
Files.writeString(Path.of("src", "test", "resources", "asyncapi.actual.json"), actual);

InputStream s = this.getClass().getResourceAsStream("/asyncapi.json");
String expectedWithoutServersKafkaUrlPatch = new String(s.readAllBytes(), StandardCharsets.UTF_8);
// When running with EmbeddedKafka, localhost is used as hostname
String expected = expectedWithoutServersKafkaUrlPatch.replace("kafka:29092", "127.0.0.1:29092");
// When running with EmbeddedKafka, the kafka bootstrap server does run on random ports
String expected = expectedWithoutServersKafkaUrlPatch.replace("kafka:29092", bootstrapServers);

assertEquals(expected, actual);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
package io.github.stavshamir.springwolf.example.cloudstream;

import org.json.JSONException;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.web.client.RestTemplate;
import org.testcontainers.containers.DockerComposeContainer;
Expand All @@ -23,6 +23,7 @@
* While the assertion of this test is identical to ApiIntegrationTests,
* the setup uses a full docker-compose context with a real kafka instance.
*/
@Slf4j
@Testcontainers
// @Ignore("Uncomment this line if you have issues running this test on your local machine.")
public class ApiSystemTest {
Expand All @@ -46,7 +47,8 @@ public class ApiSystemTest {
@Container
public static DockerComposeContainer<?> environment = new DockerComposeContainer<>(new File("docker-compose.yml"))
.withExposedService(APP_NAME, APP_PORT)
.withEnv(ENV);
.withEnv(ENV)
.withLogConsumer(APP_NAME, l -> log.debug("APP: %s".formatted(l.getUtf8StringWithoutLineEnding())));

private String baseUrl() {
String host = environment.getServiceHost(APP_NAME, APP_PORT);
Expand All @@ -55,7 +57,7 @@ private String baseUrl() {
}

@Test
void asyncapiDocsShouldReturnTheCorrectJsonResponse() throws IOException, JSONException {
void asyncapiDocsShouldReturnTheCorrectJsonResponse() throws IOException {
String url = baseUrl() + "/springwolf/docs";
String actual = restTemplate.getForObject(url, String.class);

Expand Down
5 changes: 3 additions & 2 deletions springwolf-examples/springwolf-kafka-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ dependencies {

testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"

testImplementation "com.vaadin.external.google:android-json:${androidJsonVersion}"

testImplementation "org.apache.kafka:kafka-clients:${kafkaClientsVersion}@jar"
testImplementation "org.assertj:assertj-core:${assertjCoreVersion}"
testImplementation "org.awaitility:awaitility:${awaitilityVersion}"
Expand All @@ -60,6 +58,9 @@ dependencies {

testImplementation("org.springframework.boot:spring-boot-starter-actuator")
permitTestUnusedDeclared("org.springframework.boot:spring-boot-starter-actuator")

testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
}

docker {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
package io.github.stavshamir.springwolf.example.kafka;

import org.json.JSONException;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -21,31 +20,26 @@
@SpringBootTest(
classes = {SpringwolfKafkaExampleApplication.class},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@EmbeddedKafka(
partitions = 1,
brokerProperties = {
"listeners=PLAINTEXT://localhost:9092",
"port=9092",
})
@EmbeddedKafka(partitions = 1)
@DirtiesContext
public class ApiIntegrationTest {

@Autowired
private TestRestTemplate restTemplate;

@Value("${server.port}")
public Integer serverPort;
@Value("${spring.kafka.bootstrap-servers}")
public String bootstrapServers;

@Test
void asyncApiResourceArtifactTest() throws JSONException, IOException {
void asyncApiResourceArtifactTest() throws IOException {
String url = "/springwolf/docs";
String actual = restTemplate.getForObject(url, String.class);
Files.writeString(Path.of("src", "test", "resources", "asyncapi.actual.json"), actual);

InputStream s = this.getClass().getResourceAsStream("/asyncapi.json");
String expectedWithoutServersKafkaUrlPatch = new String(s.readAllBytes(), StandardCharsets.UTF_8);
// When running with EmbeddedKafka, localhost is used as hostname
String expected = expectedWithoutServersKafkaUrlPatch.replace("kafka:29092", "127.0.0.1:9092");
// When running with EmbeddedKafka, the kafka bootstrap server does run on random ports
String expected = expectedWithoutServersKafkaUrlPatch.replace("kafka:29092", bootstrapServers);

assertEquals(expected, actual);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: Apache-2.0
package io.github.stavshamir.springwolf.example.kafka;

import org.json.JSONException;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.test.web.server.LocalServerPort;
Expand All @@ -23,12 +23,7 @@
"springwolf.endpoint.actuator.enabled=true",
"management.endpoints.web.exposure.include=springwolf"
})
@EmbeddedKafka(
partitions = 1,
brokerProperties = {
"listeners=PLAINTEXT://localhost:9092",
"port=9092",
})
@EmbeddedKafka(partitions = 1)
@DirtiesContext
public class ApiIntegrationWithActuatorIntegrationTest {

Expand All @@ -38,15 +33,18 @@ public class ApiIntegrationWithActuatorIntegrationTest {
@LocalServerPort
private int managementPort;

@Value("${spring.kafka.bootstrap-servers}")
public String bootstrapServers;

@Test
void asyncApiResourceArtifactTest() throws JSONException, IOException {
void asyncApiResourceArtifactTest() throws IOException {
String url = "http://localhost:" + managementPort + "/actuator/springwolf/docs";
String actual = restTemplate.getForObject(url, String.class);

InputStream s = this.getClass().getResourceAsStream("/asyncapi.json");
String expectedWithoutServersKafkaUrlPatch = new String(s.readAllBytes(), StandardCharsets.UTF_8);
// When running with EmbeddedKafka, localhost is used as hostname
String expected = expectedWithoutServersKafkaUrlPatch.replace("kafka:29092", "127.0.0.1:9092");
// When running with EmbeddedKafka, the kafka bootstrap server does run on random ports
String expected = expectedWithoutServersKafkaUrlPatch.replace("kafka:29092", bootstrapServers);

assertEquals(expected, actual);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
package io.github.stavshamir.springwolf.example.kafka;

import org.json.JSONException;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.web.client.RestTemplate;
import org.testcontainers.containers.DockerComposeContainer;
Expand All @@ -23,6 +23,7 @@
* While the assertion of this test is identical to ApiIntegrationTests,
* the setup uses a full docker-compose context with a real kafka instance.
*/
@Slf4j
@Testcontainers
// @Ignore("Uncomment this line if you have issues running this test on your local machine.")
public class ApiSystemTest {
Expand All @@ -46,7 +47,8 @@ public class ApiSystemTest {
@Container
public static DockerComposeContainer<?> environment = new DockerComposeContainer<>(new File("docker-compose.yml"))
.withExposedService(APP_NAME, APP_PORT)
.withEnv(ENV);
.withEnv(ENV)
.withLogConsumer(APP_NAME, l -> log.debug("APP: %s".formatted(l.getUtf8StringWithoutLineEnding())));

private String baseUrl() {
String host = environment.getServiceHost(APP_NAME, APP_PORT);
Expand All @@ -55,7 +57,7 @@ private String baseUrl() {
}

@Test
void asyncapiDocsShouldReturnTheCorrectJsonResponse() throws IOException, JSONException {
void asyncapiDocsShouldReturnTheCorrectJsonResponse() throws IOException {
String url = baseUrl() + "/springwolf/docs";
String actual = restTemplate.getForObject(url, String.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ssl.DefaultSslBundleRegistry;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.TestPropertySource;
import org.testcontainers.containers.DockerComposeContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
Expand All @@ -38,7 +39,7 @@
classes = {SpringwolfKafkaExampleApplication.class},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Testcontainers
@DirtiesContext
@TestPropertySource(properties = {"spring.kafka.bootstrap-servers=localhost:9092"})
@TestMethodOrder(OrderAnnotation.class)
// @Ignore("Uncomment this line if you have issues running this test on your local machine.")
public class ProducerSystemTest {
Expand All @@ -60,7 +61,7 @@ public class ProducerSystemTest {
@Order(1)
void verifyKafkaIsAvailable() {
Map<String, Object> consumerProperties =
properties.getPublishing().getProducer().buildProperties();
properties.getPublishing().getProducer().buildProperties(new DefaultSslBundleRegistry());
AdminClient adminClient = KafkaAdminClient.create(consumerProperties);
await().atMost(60, SECONDS)
.untilAsserted(
Expand Down
2 changes: 0 additions & 2 deletions springwolf-examples/springwolf-sns-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ dependencies {

testRuntimeOnly "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}"

testImplementation "com.vaadin.external.google:android-json:${androidJsonVersion}"

testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"

testImplementation "org.springframework.boot:spring-boot-test"
Expand Down
Loading

0 comments on commit a3e3d40

Please sign in to comment.