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