Skip to content

Commit

Permalink
stub: avoid mocking stub classes
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-mastrangelo authored Oct 5, 2017
1 parent f56be54 commit 765a40c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stub/src/main/java/io/grpc/stub/AbstractStub.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.errorprone.annotations.DoNotMock;
import io.grpc.CallCredentials;
import io.grpc.CallOptions;
import io.grpc.Channel;
Expand All @@ -42,6 +43,7 @@
* @param <S> the concrete type of this stub.
*/
@ThreadSafe
@DoNotMock
public abstract class AbstractStub<S extends AbstractStub<S>> {
private final Channel channel;
private final CallOptions callOptions;
Expand Down
2 changes: 2 additions & 0 deletions stub/src/main/java/io/grpc/stub/CallStreamObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.grpc.stub;

import com.google.errorprone.annotations.DoNotMock;
import io.grpc.ExperimentalApi;

/**
Expand All @@ -36,6 +37,7 @@
*
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1788")
@DoNotMock
public abstract class CallStreamObserver<V> implements StreamObserver<V> {

/**
Expand Down
2 changes: 2 additions & 0 deletions stub/src/main/java/io/grpc/stub/ClientCallStreamObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.grpc.stub;

import com.google.errorprone.annotations.DoNotMock;
import io.grpc.ExperimentalApi;

import javax.annotation.Nullable;
Expand All @@ -25,6 +26,7 @@
* client calls.
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1788")
@DoNotMock
public abstract class ClientCallStreamObserver<V> extends CallStreamObserver<V> {
/**
* Prevent any further processing for this {@code ClientCallStreamObserver}. No further messages
Expand Down
2 changes: 2 additions & 0 deletions stub/src/main/java/io/grpc/stub/ServerCallStreamObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

package io.grpc.stub;

import com.google.errorprone.annotations.DoNotMock;
import io.grpc.ExperimentalApi;

/**
* A refinement of {@link CallStreamObserver} to allows for interaction with call
* cancellation events on the server side.
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1788")
@DoNotMock
public abstract class ServerCallStreamObserver<V> extends CallStreamObserver<V> {

/**
Expand Down

0 comments on commit 765a40c

Please sign in to comment.