File tree Expand file tree Collapse file tree
java/org/springframework/integration/samples/grpc/server
test/java/org/springframework/integration/samples/grpc/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,9 +14,21 @@ The sample uses a simple greeting service defined in a Protocol Buffers (protobu
1414
1515### Command Line Using Gradle
1616
17+ To start the gRPC server application using Spring Boot run the following:
18+
1719 $ gradlew :grpc-server:bootRun
1820
19- This will start the gRPC server application using Spring Boot.
21+ To test the gRPC server application run the gRPC client sample using Spring Boot run as follows:
22+
23+ $ gradlew :grpc-client: bootRun
24+
25+ You should see output that looks like the following:
26+
27+ ``` log
28+ 2026-03-25T11:10:18.538-04:00 INFO 91646 --- [ main] o.s.i.s.g.c.GrpcClientConfiguration : Single response reply: Hello Jack
29+ 2026-03-25T11:10:18.544-04:00 INFO 91646 --- [ault-executor-0] o.s.i.s.g.c.GrpcClientConfiguration : Stream received reply: Hello Stream Jane
30+ 2026-03-25T11:10:18.545-04:00 INFO 91646 --- [ault-executor-0] o.s.i.s.g.c.GrpcClientConfiguration : Stream received reply: Hello again!
31+ ```
2032
2133## Testing the sample
2234
Original file line number Diff line number Diff line change 2020import org .springframework .boot .autoconfigure .SpringBootApplication ;
2121
2222/**
23- * Demonstrate Spring Integration's
23+ * The Spring Boot application to demonstrate Spring Integration's
2424 * {@link org.springframework.integration.grpc.inbound.GrpcInboundGateway} support.
2525 *
2626 * @author Glenn Renfro
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3939 * @author Glenn Renfro
4040 */
4141@ SpringBootTest ({
42- "spring.grpc.server.inprocess.name=test" ,
43- "spring.grpc.client.channels.spring-integration.address=in-process:test"
42+ "spring.grpc.server.inprocess.name=test"
4443})
4544@ ImportGrpcClients (
4645 types = {
@@ -88,8 +87,9 @@ void serverStreaming() throws InterruptedException {
8887
8988 assertThat (replyLatch .await (10_000 , TimeUnit .MILLISECONDS )).isTrue ();
9089
91- assertThat (replies .get (0 )).extracting (HelloReply ::getMessage ).isEqualTo ("Hello Stream Jane" );
92- assertThat (replies .get (1 )).extracting (HelloReply ::getMessage ).isEqualTo ("Hello again!" );
90+ assertThat (replies )
91+ .extracting (HelloReply ::getMessage )
92+ .containsOnly ("Hello Stream Jane" , "Hello again!" );
9393 }
9494
9595 /**
Original file line number Diff line number Diff line change @@ -891,10 +891,8 @@ project('grpc-client') {
891891 implementation ' org.springframework.integration:spring-integration-grpc'
892892
893893 // Test
894- testImplementation " org.springframework.boot:spring-boot-starter-grpc-test"
895-
896- configurations {
897- testRuntimeOnly. exclude group : ' io.grpc' , module : ' grpc-netty'
894+ testImplementation (' org.springframework.boot:spring-boot-starter-grpc-test' ) {
895+ exclude group : ' io.grpc' , module : ' grpc-netty'
898896 }
899897 }
900898
@@ -926,11 +924,11 @@ project('grpc-client') {
926924 }
927925
928926 springBoot {
929- mainClass = ' org.springframework.integration.samples.Application'
927+ mainClass = ' org.springframework.integration.samples.grpc.client. Application'
930928 }
931929
932930 tasks. register(' run' , JavaExec ) {
933- mainClass = ' org.springframework.integration.samples.Application'
931+ mainClass = ' org.springframework.integration.samples.grpc.client. Application'
934932 classpath = sourceSets. main. runtimeClasspath
935933 }
936934
@@ -948,10 +946,8 @@ project('grpc-server') {
948946 implementation ' org.springframework.integration:spring-integration-grpc'
949947
950948 // Test
951- testImplementation " org.springframework.boot:spring-boot-starter-grpc-test"
952-
953- configurations {
954- testRuntimeOnly. exclude group : ' io.grpc' , module : ' grpc-netty'
949+ testImplementation (' org.springframework.boot:spring-boot-starter-grpc-test' ) {
950+ exclude group : ' io.grpc' , module : ' grpc-netty'
955951 }
956952 }
957953
You can’t perform that action at this time.
0 commit comments