From bf253a74672658795fe8e36f2edabc62aa210c1d Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Thu, 24 Apr 2025 14:48:54 -0500 Subject: [PATCH] Polishing "Update to Spring Boot 3.4.5" Updates another location in test that was referencing the previous version of Spring Boot. --- samples/grpc-client/README.md | 2 +- .../sample/GrpcServerApplicationTests.java | 21 +++++++++---------- samples/grpc-server-netty-shaded/README.md | 2 +- samples/grpc-server/README.md | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/samples/grpc-client/README.md b/samples/grpc-client/README.md index e61aee7..ec5cb33 100644 --- a/samples/grpc-client/README.md +++ b/samples/grpc-client/README.md @@ -25,4 +25,4 @@ You can also build and run the application as a native image using GraalVM, in t ``` $ ./mvnw -Pnative native:compile $ ./target/grpc-client-sample -... \ No newline at end of file +... diff --git a/samples/grpc-oauth2/src/test/java/org/springframework/grpc/sample/GrpcServerApplicationTests.java b/samples/grpc-oauth2/src/test/java/org/springframework/grpc/sample/GrpcServerApplicationTests.java index c9f2c52..b0b3c8d 100644 --- a/samples/grpc-oauth2/src/test/java/org/springframework/grpc/sample/GrpcServerApplicationTests.java +++ b/samples/grpc-oauth2/src/test/java/org/springframework/grpc/sample/GrpcServerApplicationTests.java @@ -1,12 +1,15 @@ package org.springframework.grpc.sample; -import static org.junit.Assert.assertThrows; -import static org.junit.jupiter.api.Assertions.assertEquals; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import io.grpc.reflection.v1.ServerReflectionGrpc; +import io.grpc.reflection.v1.ServerReflectionRequest; +import io.grpc.reflection.v1.ServerReflectionResponse; +import io.grpc.stub.StreamObserver; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; - import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; @@ -21,8 +24,8 @@ import org.springframework.experimental.boot.server.exec.MavenClasspathEntry; import org.springframework.experimental.boot.test.context.EnableDynamicProperty; import org.springframework.experimental.boot.test.context.OAuth2ClientProviderIssuerUri; import org.springframework.grpc.client.ChannelBuilderOptions; -import org.springframework.grpc.client.ImportGrpcClients; import org.springframework.grpc.client.GrpcClientFactoryCustomizer; +import org.springframework.grpc.client.ImportGrpcClients; import org.springframework.grpc.client.interceptor.security.BearerTokenAuthenticationInterceptor; import org.springframework.grpc.sample.proto.HelloReply; import org.springframework.grpc.sample.proto.HelloRequest; @@ -33,12 +36,8 @@ import org.springframework.security.oauth2.client.registration.ClientRegistratio import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.test.annotation.DirtiesContext; -import io.grpc.Status.Code; -import io.grpc.StatusRuntimeException; -import io.grpc.reflection.v1.ServerReflectionGrpc; -import io.grpc.reflection.v1.ServerReflectionRequest; -import io.grpc.reflection.v1.ServerReflectionResponse; -import io.grpc.stub.StreamObserver; +import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; @SpringBootTest(properties = { "spring.grpc.server.port=0", "spring.grpc.client.default-channel.address=static://0.0.0.0:${local.grpc.port}" }) @@ -126,7 +125,7 @@ public class GrpcServerApplicationTests { return CommonsExecWebServerFactoryBean.builder() .useGenericSpringBootMain() .classpath(classpath -> classpath.entries(new MavenClasspathEntry( - "org.springframework.boot:spring-boot-starter-oauth2-authorization-server:3.4.4"))); + "org.springframework.boot:spring-boot-starter-oauth2-authorization-server:3.4.5"))); } @Bean diff --git a/samples/grpc-server-netty-shaded/README.md b/samples/grpc-server-netty-shaded/README.md index bfda3b7..59ab9e4 100644 --- a/samples/grpc-server-netty-shaded/README.md +++ b/samples/grpc-server-netty-shaded/README.md @@ -60,4 +60,4 @@ $ ./target/demo 2022-12-08T05:36:54.396-08:00 INFO 554359 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 0.046 seconds (process running for 0.052) ``` -The patches needed to make it work in native were a reflection hint (upstream change: https://github.com/oracle/graalvm-reachability-metadata/pull/148) and some autoconfig metadata (upstream change: https://github.com/yidongnan/grpc-spring-boot-starter/pull/775). \ No newline at end of file +The patches needed to make it work in native were a reflection hint (upstream change: https://github.com/oracle/graalvm-reachability-metadata/pull/148) and some autoconfig metadata (upstream change: https://github.com/yidongnan/grpc-spring-boot-starter/pull/775). diff --git a/samples/grpc-server/README.md b/samples/grpc-server/README.md index 6562da2..5304c4e 100644 --- a/samples/grpc-server/README.md +++ b/samples/grpc-server/README.md @@ -37,4 +37,4 @@ $ grpcurl -d '{"name":"Hi"}' -plaintext localhost:9090 Simple.SayHello ## Native Image [Native Image with Gradle](./HELP-gradle.md) -[Native Image with Maven](./HELP-maven.md) \ No newline at end of file +[Native Image with Maven](./HELP-maven.md)