Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.google.api.generator.engine.ast.ExprStatement;
import com.google.api.generator.engine.ast.MethodDefinition;
import com.google.api.generator.engine.ast.MethodInvocationExpr;
import com.google.api.generator.engine.ast.NewObjectExpr;
import com.google.api.generator.engine.ast.Reference;
import com.google.api.generator.engine.ast.ScopeNode;
import com.google.api.generator.engine.ast.Statement;
Expand Down Expand Up @@ -189,15 +190,10 @@ private static MethodDefinition createStartStaticServerMethod(
VariableExpr mockServiceVarExpr =
classMemberVarExprs.get(getMockServiceVarName(service.name()));
VariableExpr serviceHelperVarExpr = classMemberVarExprs.get(SERVICE_HELPER_VAR_NAME);
// TODO(miraleung): Actually intantiate this.
Expr initMockServiceExpr =
AssignmentExpr.builder()
.setVariableExpr(mockServiceVarExpr)
.setValueExpr(
MethodInvocationExpr.builder()
.setMethodName("newMockTodo")
.setReturnType(mockServiceVarExpr.type())
.build())
.setValueExpr(NewObjectExpr.builder().setType(mockServiceVarExpr.type()).build())
.build();

MethodInvocationExpr firstArg =
Expand All @@ -218,15 +214,14 @@ private static MethodDefinition createStartStaticServerMethod(
.setMethodName("asList")
.setArguments(Arrays.asList(mockServiceVarExpr))
.build();
// TODO(miraleung): Actually intantiate this.

Expr initServiceHelperExpr =
AssignmentExpr.builder()
.setVariableExpr(serviceHelperVarExpr)
.setValueExpr(
MethodInvocationExpr.builder()
.setMethodName("newMockServiceHelperTodo")
NewObjectExpr.builder()
.setType(serviceHelperVarExpr.type())
.setArguments(Arrays.asList(firstArg, secondArg))
.setReturnType(serviceHelperVarExpr.type())
.build())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ public void generateServiceClasses() {
+ "\n"
+ " @BeforeClass\n"
+ " public static void startStaticServer() {\n"
+ " mockEcho = newMockTodo();\n"
+ " mockEcho = new MockEcho();\n"
+ " mockServiceHelper =\n"
+ " newMockServiceHelperTodo(\n"
+ " new MockServiceHelper(\n"
+ " UUID.randomUUID().toString(), Arrays.<MockGrpcService>asList(mockEcho));\n"
+ " mockServiceHelper.start();\n"
+ " }\n"
Expand Down