Polishing "Update to Spring Boot 3.4.5"

Updates another location in test that was referencing
the previous version of Spring Boot.
This commit is contained in:
Chris Bono
2025-04-24 14:48:54 -05:00
parent f820eab1ad
commit bf253a7467
4 changed files with 13 additions and 14 deletions

View File

@@ -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
...
...

View File

@@ -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

View File

@@ -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).
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).

View File

@@ -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)
[Native Image with Maven](./HELP-maven.md)