Skip to content

Commit 76322a0

Browse files
author
Oliver Trosien
committed
Do proper assertion in GreeterAppTest + imports cleanup
1 parent ad72de0 commit 76322a0

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/GreeterAppTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public void simpleGreeting() throws ExecutionException, InterruptedException {
4949
final GreeterOuterClass.HelloRequest
5050
helloRequest =
5151
GreeterOuterClass.HelloRequest.newBuilder().setName("John").build();
52-
final String replay = greeterFutureStub.sayHello(helloRequest).get().getMessage();
53-
System.out.println(replay);
52+
final String reply = greeterFutureStub.sayHello(helloRequest).get().getMessage();
53+
assertEquals("Hello John", reply);
5454
}
5555

5656
@Test

grpc-spring-boot-starter/src/main/java/org/lognet/springboot/grpc/GRpcServerRunner.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
package org.lognet.springboot.grpc;
22

3-
import java.lang.reflect.Method;
4-
import java.util.Arrays;
53
import java.util.Optional;
64

7-
import io.grpc.BindableService;
85
import org.lognet.springboot.grpc.autoconfigure.GRpcServerProperties;
96
import org.springframework.beans.factory.DisposableBean;
107
import org.springframework.beans.factory.annotation.Autowired;
118
import org.springframework.boot.CommandLineRunner;
129
import org.springframework.context.ApplicationContext;
13-
import org.springframework.core.annotation.AnnotationUtils;
14-
import org.springframework.util.ReflectionUtils;
1510

11+
import io.grpc.BindableService;
1612
import io.grpc.Server;
1713
import io.grpc.ServerBuilder;
18-
import io.grpc.ServerServiceDefinition;
1914
import lombok.extern.slf4j.Slf4j;
2015

2116
/**
@@ -24,8 +19,6 @@
2419
@Slf4j
2520
public class GRpcServerRunner implements CommandLineRunner,DisposableBean {
2621

27-
28-
2922
@Autowired
3023
private ApplicationContext applicationContext;
3124

0 commit comments

Comments
 (0)