61
61
import io .grpc .StatusException ;
62
62
import io .grpc .internal .ClientTransport ;
63
63
import io .grpc .internal .ClientTransport .PingCallback ;
64
- import io .grpc .internal .GrpcUtil ;
65
64
import io .netty .buffer .ByteBuf ;
66
65
import io .netty .buffer .ByteBufUtil ;
67
66
import io .netty .buffer .Unpooled ;
@@ -271,7 +270,8 @@ public void receivedGoAwayShouldCancelBufferedStream() throws Exception {
271
270
assertTrue (future .isDone ());
272
271
assertFalse (future .isSuccess ());
273
272
Status status = Status .fromThrowable (future .cause ());
274
- assertEquals (GrpcUtil .Http2Error .NO_ERROR .status (), status );
273
+ assertEquals (Status .Code .UNAVAILABLE , status .getCode ());
274
+ assertEquals ("HTTP/2 error code: NO_ERROR\n Received Goaway" , status .getDescription ());
275
275
}
276
276
277
277
@ Test
@@ -284,7 +284,7 @@ public void receivedGoAwayShouldFailUnknownStreams() throws Exception {
284
284
verify (stream ).transportReportStatus (captor .capture (), eq (false ),
285
285
notNull (Metadata .class ));
286
286
assertEquals (Status .CANCELLED .getCode (), captor .getValue ().getCode ());
287
- assertEquals ("HTTP/2 error code: CANCEL\n this is a test" ,
287
+ assertEquals ("HTTP/2 error code: CANCEL\n Received Goaway \ n this is a test" ,
288
288
captor .getValue ().getDescription ());
289
289
}
290
290
@@ -300,7 +300,8 @@ public void receivedGoAwayShouldFailUnknownBufferedStreams() throws Exception {
300
300
assertFalse (future .isSuccess ());
301
301
Status status = Status .fromThrowable (future .cause ());
302
302
assertEquals (Status .CANCELLED .getCode (), status .getCode ());
303
- assertEquals ("HTTP/2 error code: CANCEL\n this is a test" , status .getDescription ());
303
+ assertEquals ("HTTP/2 error code: CANCEL\n Received Goaway\n this is a test" ,
304
+ status .getDescription ());
304
305
}
305
306
306
307
@ Test
@@ -314,7 +315,8 @@ public void receivedGoAwayShouldFailNewStreams() throws Exception {
314
315
assertFalse (future .isSuccess ());
315
316
Status status = Status .fromThrowable (future .cause ());
316
317
assertEquals (Status .CANCELLED .getCode (), status .getCode ());
317
- assertEquals ("HTTP/2 error code: CANCEL\n this is a test" , status .getDescription ());
318
+ assertEquals ("HTTP/2 error code: CANCEL\n Received Goaway\n this is a test" ,
319
+ status .getDescription ());
318
320
}
319
321
320
322
@ Test
0 commit comments