Closed rfscouto closed 4 months ago
Hi @rfscouto , thanks for the PR. Though I'm not sure that I'd want to raise the required JDK to 17 and default spring-boot to 3, as it's quite new. Doesn't gRPCMock work in spring-boot 3 without these changes, since the spring boot integration doesn't tie to a specific version of the library and should allow to run it if the newer version is API compatible?
Hi! I mostly created the PR to have this work scheduled for the future as it will be eventually required. gRPCmock should work in Spring Boot 3 projects as a dependency based on my current tests and the adjustment to the TestSockUtils on my prior PR, I’ve not adapted those changes on my personal projects since gRPC libs themselves were not Spring Boot 3 compatible - breaking the gRPC communication. You can close the PR or put it to draft, as you think is best.
On 9. Dec 2022, at 11:58, Paulius Paplauskas @.***> wrote:
Hi @rfscouto https://github.com/rfscouto , thanks for the PR. Though I'm not sure that I'd want to raise the required JDK to 17 and default spring-boot to 3, as it's quite new. Doesn't gRPCMock work in spring-boot 3 without these changes, since the spring boot integration doesn't tie to a specific version of the library and should allow to run it if the newer version is API compatible?
— Reply to this email directly, view it on GitHub https://github.com/Fadelis/grpcmock/pull/25#issuecomment-1344155788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW4CDTFCWDV76JQVJDFYWTWMMGFXANCNFSM6AAAAAASLMUYUQ. You are receiving this because you were mentioned.
I've upgraded to Java 17, a pre-requirement for Spring Boot 3. Hope there are no issues with the build and release pipelines.
According to the Spring Boot 3 migration guide (https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide):
Until grpc-java allows a way to not add the
javax.annotation.Generated
by default, or moves tojakarta.annotation.Generated
, we rely on having thejavax.annotation-api
dependency. https://github.com/grpc/grpc-java/issues/9179I faced also issues with mocking the new
DefaultListableBeanFactory
on theGrpcMockConfigurationTest
; I believe it might be an issue with Mockito and Java 17? https://github.com/mockito/mockito/issues/2272 https://github.com/mockito/mockito/issues/2589For the time being, I've resorted to getting the actual implementation of
DefaultListableBeanFactory
through its default constructor. Open to suggestions here.The verify step was failing, because
spotbugs
was reporting:Low: Overridable method logServerStarted is called from constructor new org.grpcmock.junit5.GrpcMockExtension(GrpcMock). [org.grpcmock.junit5.GrpcMockExtension] At GrpcMockExtension.java:[line 44] MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR
Which is weird, because there were no changes in this file.
spotbugs
version was updated after I got the error above.