diff options
author | dapengzhang0 <zdapeng@google.com> | 2017-11-22 14:28:15 -0800 |
---|---|---|
committer | ZHANG Dapeng <zdapeng@google.com> | 2017-11-22 16:09:59 -0800 |
commit | baebca213e9bcbac747b5a3b532731f80aee8825 (patch) | |
tree | 8109a4349883268a30bac88a79959cd7d0f5faf2 /testing | |
parent | cdb1f54794e647848dbccf5233b47b1935529813 (diff) | |
download | grpc-grpc-java-baebca213e9bcbac747b5a3b532731f80aee8825.tar.gz |
testing: remove deprecated noopMethodDescriptor
Diffstat (limited to 'testing')
-rw-r--r-- | testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java b/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java index b28915278..c1f2464ae 100644 --- a/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java +++ b/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java @@ -49,60 +49,23 @@ public final class TestMethodDescriptors { } /** - * Creates a new method descriptor that always creates zero length messages, and always parses to - * null objects. - * - * @deprecated Prefer to use {@link #voidMethod()} instead or use one MethodDescriptor from {@code - * io.grpc.testing.protobuf.SimpleServiceGrpc} or from other generated classes. - * @since 1.1.0 - */ - @Deprecated - @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2600") - public static <ReqT, RespT> MethodDescriptor<ReqT, RespT> noopMethod() { - return noopMethod("service_foo", "method_bar"); - } - - @Deprecated - private static <ReqT, RespT> MethodDescriptor<ReqT, RespT> noopMethod( - String serviceName, String methodName) { - return MethodDescriptor.<ReqT, RespT>newBuilder() - .setType(MethodType.UNARY) - .setFullMethodName(MethodDescriptor.generateFullMethodName(serviceName, methodName)) - .setRequestMarshaller(TestMethodDescriptors.<ReqT>noopMarshaller()) - .setResponseMarshaller(TestMethodDescriptors.<RespT>noopMarshaller()) - .build(); - } - - /** * Creates a new marshaller that does nothing. * * @since 1.1.0 */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2600") public static MethodDescriptor.Marshaller<Void> voidMarshaller() { - return new NoopMarshaller<Void>(); - } - - /** - * Creates a new marshaller that does nothing. - * - * @deprecated Use {@link #voidMarshaller()} instead or implement/mock one - * @since 1.1.0 - */ - @Deprecated - @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2600") - public static <T> MethodDescriptor.Marshaller<T> noopMarshaller() { - return new NoopMarshaller<T>(); + return new NoopMarshaller(); } - private static final class NoopMarshaller<T> implements MethodDescriptor.Marshaller<T> { + private static final class NoopMarshaller implements MethodDescriptor.Marshaller<Void> { @Override - public InputStream stream(T value) { + public InputStream stream(Void value) { return new ByteArrayInputStream(new byte[]{}); } @Override - public T parse(InputStream stream) { + public Void parse(InputStream stream) { return null; } } |