Skip to content

Commit

Permalink
[ggj][codegen] fix: handle clientStreamingCall in generated tests (#586)
Browse files Browse the repository at this point in the history
* fix: fix dep ordering in Bazel dedupe rules

* fix: use lowerCamelCase for string types in DefaultValueComposer

* fix: handle clientStreamingCall in  generated tests
  • Loading branch information
miraleung authored Dec 4, 2020
1 parent 1cc2b77 commit 98bb43d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,8 @@ private static MethodDefinition createStreamingRpcTestMethod(
.setName("requestObserver")
.build());
List<Expr> callableMethodArgs = new ArrayList<>();
if (!method.stream().equals(Method.Stream.BIDI)) {
if (!method.stream().equals(Method.Stream.BIDI)
&& !method.stream().equals(Method.Stream.CLIENT)) {
callableMethodArgs.add(requestVarExpr);
}
callableMethodArgs.add(responseObserverVarExpr);
Expand Down Expand Up @@ -1361,7 +1362,8 @@ private static List<Statement> createStreamingRpcExceptionTestStatements(
.build());

List<Expr> callableMethodArgs = new ArrayList<>();
if (!method.stream().equals(Method.Stream.BIDI)) {
if (!method.stream().equals(Method.Stream.BIDI)
&& !method.stream().equals(Method.Stream.CLIENT)) {
callableMethodArgs.add(requestVarExpr);
}
callableMethodArgs.add(responseObserverVarExpr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,7 @@ public class EchoClientTest {
MockStreamObserver<EchoResponse> responseObserver = new MockStreamObserver<>();

ClientStreamingCallable<EchoRequest, EchoResponse> callable = client.collectCallable();
ApiStreamObserver<EchoRequest> requestObserver =
callable.clientStreamingCall(request, responseObserver);
ApiStreamObserver<EchoRequest> requestObserver = callable.clientStreamingCall(responseObserver);

requestObserver.onNext(request);
requestObserver.onCompleted();
Expand All @@ -449,8 +448,7 @@ public class EchoClientTest {
MockStreamObserver<EchoResponse> responseObserver = new MockStreamObserver<>();

ClientStreamingCallable<EchoRequest, EchoResponse> callable = client.collectCallable();
ApiStreamObserver<EchoRequest> requestObserver =
callable.clientStreamingCall(request, responseObserver);
ApiStreamObserver<EchoRequest> requestObserver = callable.clientStreamingCall(responseObserver);

requestObserver.onNext(request);

Expand Down

0 comments on commit 98bb43d

Please sign in to comment.