@@ -85,6 +85,15 @@ private TestServiceGrpc() {}
8585 "grpc.testing.TestService" , "HalfDuplexCall" ),
8686 io .grpc .protobuf .ProtoUtils .marshaller (io .grpc .testing .integration .Messages .StreamingOutputCallRequest .getDefaultInstance ()),
8787 io .grpc .protobuf .ProtoUtils .marshaller (io .grpc .testing .integration .Messages .StreamingOutputCallResponse .getDefaultInstance ()));
88+ @ io .grpc .ExperimentalApi ("https://github.com/grpc/grpc-java/issues/1901" )
89+ public static final io .grpc .MethodDescriptor <com .google .protobuf .EmptyProtos .Empty ,
90+ com .google .protobuf .EmptyProtos .Empty > METHOD_UNIMPLEMENTED_CALL =
91+ io .grpc .MethodDescriptor .create (
92+ io .grpc .MethodDescriptor .MethodType .UNARY ,
93+ generateFullMethodName (
94+ "grpc.testing.TestService" , "UnimplementedCall" ),
95+ io .grpc .protobuf .ProtoUtils .marshaller (com .google .protobuf .EmptyProtos .Empty .getDefaultInstance ()),
96+ io .grpc .protobuf .ProtoUtils .marshaller (com .google .protobuf .EmptyProtos .Empty .getDefaultInstance ()));
8897
8998 /**
9099 * Creates a new async stub that supports all call types for the service
@@ -184,6 +193,17 @@ public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.Streamin
184193 return asyncUnimplementedStreamingCall (METHOD_HALF_DUPLEX_CALL , responseObserver );
185194 }
186195
196+ /**
197+ * <pre>
198+ * The test server will not implement this method. It will be used
199+ * to test the behavior when clients call unimplemented methods.
200+ * </pre>
201+ */
202+ public void unimplementedCall (com .google .protobuf .EmptyProtos .Empty request ,
203+ io .grpc .stub .StreamObserver <com .google .protobuf .EmptyProtos .Empty > responseObserver ) {
204+ asyncUnimplementedUnaryCall (METHOD_UNIMPLEMENTED_CALL , responseObserver );
205+ }
206+
187207 @ java .lang .Override public io .grpc .ServerServiceDefinition bindService () {
188208 return io .grpc .ServerServiceDefinition .builder (getServiceDescriptor ())
189209 .addMethod (
@@ -228,6 +248,13 @@ public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.Streamin
228248 io .grpc .testing .integration .Messages .StreamingOutputCallRequest ,
229249 io .grpc .testing .integration .Messages .StreamingOutputCallResponse >(
230250 this , METHODID_HALF_DUPLEX_CALL )))
251+ .addMethod (
252+ METHOD_UNIMPLEMENTED_CALL ,
253+ asyncUnaryCall (
254+ new MethodHandlers <
255+ com .google .protobuf .EmptyProtos .Empty ,
256+ com .google .protobuf .EmptyProtos .Empty >(
257+ this , METHODID_UNIMPLEMENTED_CALL )))
231258 .build ();
232259 }
233260 }
@@ -326,6 +353,18 @@ public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.Streamin
326353 return asyncBidiStreamingCall (
327354 getChannel ().newCall (METHOD_HALF_DUPLEX_CALL , getCallOptions ()), responseObserver );
328355 }
356+
357+ /**
358+ * <pre>
359+ * The test server will not implement this method. It will be used
360+ * to test the behavior when clients call unimplemented methods.
361+ * </pre>
362+ */
363+ public void unimplementedCall (com .google .protobuf .EmptyProtos .Empty request ,
364+ io .grpc .stub .StreamObserver <com .google .protobuf .EmptyProtos .Empty > responseObserver ) {
365+ asyncUnaryCall (
366+ getChannel ().newCall (METHOD_UNIMPLEMENTED_CALL , getCallOptions ()), request , responseObserver );
367+ }
329368 }
330369
331370 /**
@@ -381,6 +420,17 @@ public java.util.Iterator<io.grpc.testing.integration.Messages.StreamingOutputCa
381420 return blockingServerStreamingCall (
382421 getChannel (), METHOD_STREAMING_OUTPUT_CALL , getCallOptions (), request );
383422 }
423+
424+ /**
425+ * <pre>
426+ * The test server will not implement this method. It will be used
427+ * to test the behavior when clients call unimplemented methods.
428+ * </pre>
429+ */
430+ public com .google .protobuf .EmptyProtos .Empty unimplementedCall (com .google .protobuf .EmptyProtos .Empty request ) {
431+ return blockingUnaryCall (
432+ getChannel (), METHOD_UNIMPLEMENTED_CALL , getCallOptions (), request );
433+ }
384434 }
385435
386436 /**
@@ -426,14 +476,27 @@ public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integr
426476 return futureUnaryCall (
427477 getChannel ().newCall (METHOD_UNARY_CALL , getCallOptions ()), request );
428478 }
479+
480+ /**
481+ * <pre>
482+ * The test server will not implement this method. It will be used
483+ * to test the behavior when clients call unimplemented methods.
484+ * </pre>
485+ */
486+ public com .google .common .util .concurrent .ListenableFuture <com .google .protobuf .EmptyProtos .Empty > unimplementedCall (
487+ com .google .protobuf .EmptyProtos .Empty request ) {
488+ return futureUnaryCall (
489+ getChannel ().newCall (METHOD_UNIMPLEMENTED_CALL , getCallOptions ()), request );
490+ }
429491 }
430492
431493 private static final int METHODID_EMPTY_CALL = 0 ;
432494 private static final int METHODID_UNARY_CALL = 1 ;
433495 private static final int METHODID_STREAMING_OUTPUT_CALL = 2 ;
434- private static final int METHODID_STREAMING_INPUT_CALL = 3 ;
435- private static final int METHODID_FULL_DUPLEX_CALL = 4 ;
436- private static final int METHODID_HALF_DUPLEX_CALL = 5 ;
496+ private static final int METHODID_UNIMPLEMENTED_CALL = 3 ;
497+ private static final int METHODID_STREAMING_INPUT_CALL = 4 ;
498+ private static final int METHODID_FULL_DUPLEX_CALL = 5 ;
499+ private static final int METHODID_HALF_DUPLEX_CALL = 6 ;
437500
438501 private static class MethodHandlers <Req , Resp > implements
439502 io .grpc .stub .ServerCalls .UnaryMethod <Req , Resp >,
@@ -464,6 +527,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv
464527 serviceImpl .streamingOutputCall ((io .grpc .testing .integration .Messages .StreamingOutputCallRequest ) request ,
465528 (io .grpc .stub .StreamObserver <io .grpc .testing .integration .Messages .StreamingOutputCallResponse >) responseObserver );
466529 break ;
530+ case METHODID_UNIMPLEMENTED_CALL :
531+ serviceImpl .unimplementedCall ((com .google .protobuf .EmptyProtos .Empty ) request ,
532+ (io .grpc .stub .StreamObserver <com .google .protobuf .EmptyProtos .Empty >) responseObserver );
533+ break ;
467534 default :
468535 throw new AssertionError ();
469536 }
@@ -499,7 +566,8 @@ public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
499566 METHOD_STREAMING_OUTPUT_CALL ,
500567 METHOD_STREAMING_INPUT_CALL ,
501568 METHOD_FULL_DUPLEX_CALL ,
502- METHOD_HALF_DUPLEX_CALL );
569+ METHOD_HALF_DUPLEX_CALL ,
570+ METHOD_UNIMPLEMENTED_CALL );
503571 }
504572
505573 return serviceDescriptor ;
0 commit comments