Skip to content

Commit e095cf8

Browse files
Bump io.github.mfvanek:pg-index-health-bom from 0.13.2 to 0.13.3 (#185)
* Bump io.github.mfvanek:pg-index-health-bom from 0.13.2 to 0.13.3 Bumps [io.github.mfvanek:pg-index-health-bom](https://github.com/mfvanek/pg-index-health) from 0.13.2 to 0.13.3. - [Release notes](https://github.com/mfvanek/pg-index-health/releases) - [Commits](mfvanek/pg-index-health@v.0.13.2...v.0.13.3) --- updated-dependencies: - dependency-name: io.github.mfvanek:pg-index-health-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Upgrade Gradle * Reformat code --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivan Vakhrushev <[email protected]>
1 parent de07b0d commit e095cf8

File tree

23 files changed

+205
-224
lines changed

23 files changed

+205
-224
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "Experiments with Java"
99

1010
allprojects {
1111
group = "io.github.mfvanek"
12-
version = "0.2.1"
12+
version = "0.2.2"
1313

1414
repositories {
1515
mavenLocal()
@@ -19,7 +19,7 @@ allprojects {
1919

2020
tasks {
2121
wrapper {
22-
gradleVersion = "8.10.2"
22+
gradleVersion = "8.11"
2323
}
2424
}
2525

common-internal-bom/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies {
1212
api(platform("org.assertj:assertj-bom:3.26.3"))
1313
api(platform("org.testcontainers:testcontainers-bom:1.20.3"))
1414
api(platform("org.junit:junit-bom:5.11.3"))
15-
api(platform("io.github.mfvanek:pg-index-health-bom:0.13.2"))
15+
api(platform("io.github.mfvanek:pg-index-health-bom:0.13.3"))
1616

1717
constraints {
1818
api("org.liquibase:liquibase-core:4.30.0")

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

spring-boot-2-demo-app/src/main/java/io/github/mfvanek/spring/boot2/test/controllers/TimeController.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package io.github.mfvanek.spring.boot2.test.controllers;
22

3-
import java.time.Clock;
4-
import java.util.Optional;
5-
63
import io.github.mfvanek.spring.boot2.test.service.KafkaSendingService;
74
import lombok.RequiredArgsConstructor;
85
import lombok.SneakyThrows;
@@ -13,7 +10,9 @@
1310
import org.springframework.web.bind.annotation.GetMapping;
1411
import org.springframework.web.bind.annotation.RestController;
1512

13+
import java.time.Clock;
1614
import java.time.LocalDateTime;
15+
import java.util.Optional;
1716

1817
@Slf4j
1918
@RestController
@@ -29,14 +28,14 @@ public class TimeController {
2928
@GetMapping(path = "/current-time")
3029
public LocalDateTime getNow() {
3130
final var traceId = Optional.ofNullable(tracer.currentSpan())
32-
.map(Span::context)
33-
.map(TraceContext::traceId)
34-
.orElse(null);
31+
.map(Span::context)
32+
.map(TraceContext::traceId)
33+
.orElse(null);
3534
log.info("Called method getNow. TraceId = {}", traceId);
3635
final LocalDateTime now = LocalDateTime.now(clock);
3736
kafkaSendingService.sendNotification("Current time = " + now)
38-
.thenRun(() -> log.info("Awaiting acknowledgement from Kafka"))
39-
.get();
37+
.thenRun(() -> log.info("Awaiting acknowledgement from Kafka"))
38+
.get();
4039
return now;
4140
}
4241
}

spring-boot-2-demo-app/src/main/java/io/github/mfvanek/spring/boot2/test/filters/TraceIdInResponseServletFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import org.springframework.cloud.sleuth.Tracer;
66
import org.springframework.stereotype.Component;
77

8+
import java.io.IOException;
89
import javax.servlet.Filter;
910
import javax.servlet.FilterChain;
1011
import javax.servlet.ServletException;
1112
import javax.servlet.ServletRequest;
1213
import javax.servlet.ServletResponse;
1314
import javax.servlet.http.HttpServletResponse;
14-
import java.io.IOException;
1515

1616
@Component
1717
@RequiredArgsConstructor
@@ -23,7 +23,7 @@ public class TraceIdInResponseServletFilter implements Filter {
2323

2424
@Override
2525
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
26-
throws IOException, ServletException {
26+
throws IOException, ServletException {
2727
final Span currentSpan = tracer.currentSpan();
2828
if (currentSpan != null) {
2929
HttpServletResponse resp = (HttpServletResponse) response;

spring-boot-2-demo-app/src/main/java/io/github/mfvanek/spring/boot2/test/service/KafkaReadingService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public void listen(ConsumerRecord<UUID, String> message, Acknowledgment ack) {
3030
final String traceId = currentSpan != null ? currentSpan.context().traceId() : "";
3131
log.info("Received record: {} with traceId {}", message.value(), traceId);
3232
jdbcTemplate.update("insert into otel_demo.storage(message, trace_id, created_at) values(:msg, :traceId, :createdAt);",
33-
Map.ofEntries(
34-
Map.entry("msg", message.value()),
35-
Map.entry("traceId", traceId),
36-
Map.entry("createdAt", LocalDateTime.now(clock))
37-
)
33+
Map.ofEntries(
34+
Map.entry("msg", message.value()),
35+
Map.entry("traceId", traceId),
36+
Map.entry("createdAt", LocalDateTime.now(clock))
37+
)
3838
);
3939
ack.acknowledge();
4040
}

spring-boot-2-demo-app/src/main/java/io/github/mfvanek/spring/boot2/test/service/KafkaSendingService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import org.springframework.kafka.support.SendResult;
77
import org.springframework.stereotype.Service;
88

9-
import javax.annotation.Nonnull;
109
import java.util.UUID;
1110
import java.util.concurrent.CompletableFuture;
11+
import javax.annotation.Nonnull;
1212

1313
@Slf4j
1414
@Service

spring-boot-2-demo-app/src/test/java/io/github/mfvanek/spring/boot2/test/ActuatorEndpointTest.java

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,82 +26,82 @@ class ActuatorEndpointTest extends TestBase {
2626
@BeforeEach
2727
void setUp() {
2828
this.actuatorClient = WebTestClient.bindToServer()
29-
.baseUrl("http://localhost:" + actuatorPort + "/actuator/")
30-
.build();
29+
.baseUrl("http://localhost:" + actuatorPort + "/actuator/")
30+
.build();
3131
}
3232

3333
@Test
3434
void actuatorShouldBeRunOnSeparatePort() {
3535
assertThat(actuatorPort)
36-
.isNotEqualTo(port);
36+
.isNotEqualTo(port);
3737
}
3838

3939
@ParameterizedTest
4040
@CsvSource(value = {
41-
"prometheus|jvm_threads_live_threads|text/plain",
42-
"health|{\"status\":\"UP\",\"groups\":[\"liveness\",\"readiness\"]}|application/json",
43-
"health/liveness|{\"status\":\"UP\"}|application/json",
44-
"health/readiness|{\"status\":\"UP\"}|application/json",
45-
"info|\"version\":|application/json"}, delimiter = '|')
41+
"prometheus|jvm_threads_live_threads|text/plain",
42+
"health|{\"status\":\"UP\",\"groups\":[\"liveness\",\"readiness\"]}|application/json",
43+
"health/liveness|{\"status\":\"UP\"}|application/json",
44+
"health/readiness|{\"status\":\"UP\"}|application/json",
45+
"info|\"version\":|application/json"}, delimiter = '|')
4646
void actuatorEndpointShouldReturnOk(@Nonnull final String endpointName,
4747
@Nonnull final String expectedSubstring,
4848
@Nonnull final String mediaType) {
4949
final var result = actuatorClient.get()
50-
.uri(uriBuilder -> uriBuilder
51-
.path(endpointName)
52-
.build())
53-
.accept(MediaType.valueOf(mediaType))
54-
.exchange()
55-
.expectStatus().isOk()
56-
.expectBody(String.class)
57-
.returnResult()
58-
.getResponseBody();
50+
.uri(uriBuilder -> uriBuilder
51+
.path(endpointName)
52+
.build())
53+
.accept(MediaType.valueOf(mediaType))
54+
.exchange()
55+
.expectStatus().isOk()
56+
.expectBody(String.class)
57+
.returnResult()
58+
.getResponseBody();
5959
assertThat(result)
60-
.contains(expectedSubstring);
60+
.contains(expectedSubstring);
6161
}
6262

6363
@Test
6464
void swaggerUiEndpointShouldReturnFound() {
6565
final var result = actuatorClient.get()
66-
.uri(uriBuilder -> uriBuilder
67-
.pathSegment("swagger-ui")
68-
.build())
69-
.accept(MediaType.TEXT_HTML)
70-
.exchange()
71-
.expectStatus().isFound()
72-
.expectHeader().location("/actuator/swagger-ui/index.html")
73-
.expectBody()
74-
.returnResult()
75-
.getResponseBody();
66+
.uri(uriBuilder -> uriBuilder
67+
.pathSegment("swagger-ui")
68+
.build())
69+
.accept(MediaType.TEXT_HTML)
70+
.exchange()
71+
.expectStatus().isFound()
72+
.expectHeader().location("/actuator/swagger-ui/index.html")
73+
.expectBody()
74+
.returnResult()
75+
.getResponseBody();
7676
assertThat(result).isNull();
7777
}
7878

7979
@Test
8080
void readinessProbeShouldBeCollectedFromApplicationMainPort() {
8181
final var result = webTestClient.get()
82-
.uri(uriBuilder -> uriBuilder
83-
.pathSegment("readyz")
84-
.build())
85-
.accept(MediaType.APPLICATION_JSON)
86-
.exchange()
87-
.expectStatus().isOk()
88-
.expectBody(String.class)
89-
.returnResult()
90-
.getResponseBody();
82+
.uri(uriBuilder -> uriBuilder
83+
.pathSegment("readyz")
84+
.build())
85+
.accept(MediaType.APPLICATION_JSON)
86+
.exchange()
87+
.expectStatus().isOk()
88+
.expectBody(String.class)
89+
.returnResult()
90+
.getResponseBody();
9191
assertThat(result)
92-
.isEqualTo("{\"status\":\"UP\"}");
92+
.isEqualTo("{\"status\":\"UP\"}");
9393

9494
final String metricsResult = actuatorClient.get()
95-
.uri(uriBuilder -> uriBuilder
96-
.path("prometheus")
97-
.build())
98-
.accept(MediaType.valueOf("text/plain"))
99-
.exchange()
100-
.expectStatus().isOk()
101-
.expectBody(String.class)
102-
.returnResult()
103-
.getResponseBody();
95+
.uri(uriBuilder -> uriBuilder
96+
.path("prometheus")
97+
.build())
98+
.accept(MediaType.valueOf("text/plain"))
99+
.exchange()
100+
.expectStatus().isOk()
101+
.expectBody(String.class)
102+
.returnResult()
103+
.getResponseBody();
104104
assertThat(metricsResult)
105-
.contains("http_server_requests_seconds_bucket");
105+
.contains("http_server_requests_seconds_bucket");
106106
}
107107
}

spring-boot-2-demo-app/src/test/java/io/github/mfvanek/spring/boot2/test/IndexesMaintenanceTest.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
55
import io.github.mfvanek.pg.model.DbObject;
66
import io.github.mfvanek.pg.model.PgContext;
7-
import io.github.mfvanek.pg.model.table.TableNameAware;
7+
import io.github.mfvanek.pg.model.predicates.SkipLiquibaseTablesPredicate;
88
import io.github.mfvanek.spring.boot2.test.support.TestBase;
99
import org.junit.jupiter.api.DisplayName;
1010
import org.junit.jupiter.api.Test;
1111
import org.springframework.beans.factory.annotation.Autowired;
1212

1313
import java.util.List;
14-
import java.util.function.Predicate;
1514

1615
import static org.assertj.core.api.Assertions.assertThat;
1716

@@ -35,17 +34,9 @@ void databaseStructureCheckForPublicSchema() {
3534

3635
checks.stream()
3736
.filter(DatabaseCheckOnHost::isStatic)
38-
.forEach(check -> {
39-
final Predicate<DbObject> skipLiquibaseTables = dbObject -> {
40-
if (dbObject instanceof TableNameAware t) {
41-
return !t.getTableName().equalsIgnoreCase("databasechangelog");
42-
}
43-
return true;
44-
};
45-
final List<? extends DbObject> objects = check.check(PgContext.ofPublic(), skipLiquibaseTables);
46-
assertThat(objects)
37+
.forEach(check ->
38+
assertThat(check.check(PgContext.ofPublic(), SkipLiquibaseTablesPredicate.ofPublic()))
4739
.as(check.getDiagnostic().name())
48-
.isEmpty();
49-
});
40+
.isEmpty());
5041
}
5142
}

0 commit comments

Comments
 (0)