diff --git a/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java b/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java index b289152786..c1f2464ae4 100644 --- a/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java +++ b/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java @@ -48,31 +48,6 @@ public final class TestMethodDescriptors { .build(); } - /** - * 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 MethodDescriptor noopMethod() { - return noopMethod("service_foo", "method_bar"); - } - - @Deprecated - private static MethodDescriptor noopMethod( - String serviceName, String methodName) { - return MethodDescriptor.newBuilder() - .setType(MethodType.UNARY) - .setFullMethodName(MethodDescriptor.generateFullMethodName(serviceName, methodName)) - .setRequestMarshaller(TestMethodDescriptors.noopMarshaller()) - .setResponseMarshaller(TestMethodDescriptors.noopMarshaller()) - .build(); - } - /** * Creates a new marshaller that does nothing. * @@ -80,29 +55,17 @@ public final class TestMethodDescriptors { */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2600") public static MethodDescriptor.Marshaller voidMarshaller() { - return new NoopMarshaller(); + return new NoopMarshaller(); } - /** - * 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 MethodDescriptor.Marshaller noopMarshaller() { - return new NoopMarshaller(); - } - - private static final class NoopMarshaller implements MethodDescriptor.Marshaller { + private static final class NoopMarshaller implements MethodDescriptor.Marshaller { @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; } }