File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11package org .lognet .springboot .grpc ;
22
3- import static org .junit .Assert .assertEquals ;
3+ import static org .junit .Assert .* ;
44import static org .springframework .boot .test .context .SpringBootTest .WebEnvironment .DEFINED_PORT ;
55
66import java .util .concurrent .ExecutionException ;
@@ -44,13 +44,12 @@ public void tearDown() {
4444
4545 @ Test
4646 public void simpleGreeting () throws ExecutionException , InterruptedException {
47-
47+ String name = "John" ;
4848 final GreeterGrpc .GreeterFutureStub greeterFutureStub = GreeterGrpc .newFutureStub (channel );
49- final GreeterOuterClass .HelloRequest
50- helloRequest =
51- GreeterOuterClass .HelloRequest .newBuilder ().setName ("John" ).build ();
49+ final GreeterOuterClass .HelloRequest helloRequest =GreeterOuterClass .HelloRequest .newBuilder ().setName (name ).build ();
5250 final String reply = greeterFutureStub .sayHello (helloRequest ).get ().getMessage ();
53- assertEquals ("Hello John" , reply );
51+ assertNotNull (reply );
52+ assertTrue (String .format ("Replay should contain name '%s'" ,name ),reply .contains (name ));
5453 }
5554
5655 @ Test
You can’t perform that action at this time.
0 commit comments