Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ggj][codegen][test] fix: ensure all testgen methods throw Exceptions #407

Merged
merged 12 commits into from
Oct 24, 2020
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 @@ -920,6 +920,7 @@ private static MethodDefinition createRpcTestMethod(
.setScope(ScopeNode.PUBLIC)
.setReturnType(TypeNode.VOID)
.setName(testMethodName)
.setThrowsExceptions(Arrays.asList(TypeNode.withExceptionClazz(Exception.class)))
.setBody(methodStatements)
.build();
}
Expand Down Expand Up @@ -1175,6 +1176,7 @@ private static MethodDefinition createStreamingRpcTestMethod(
.setScope(ScopeNode.PUBLIC)
.setReturnType(TypeNode.VOID)
.setName(testMethodName)
.setThrowsExceptions(Arrays.asList(TypeNode.withExceptionClazz(Exception.class)))
.setBody(methodStatements)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class EchoClientTest {
}

@Test
public void echoTest() {
public void echoTest() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -112,7 +112,7 @@ public class EchoClientTest {
}

@Test
public void echoTest2() {
public void echoTest2() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -148,7 +148,7 @@ public class EchoClientTest {
}

@Test
public void echoTest3() {
public void echoTest3() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -184,7 +184,7 @@ public class EchoClientTest {
}

@Test
public void echoTest4() {
public void echoTest4() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -220,7 +220,7 @@ public class EchoClientTest {
}

@Test
public void echoTest5() {
public void echoTest5() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -256,7 +256,7 @@ public class EchoClientTest {
}

@Test
public void echoTest6() {
public void echoTest6() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -292,7 +292,7 @@ public class EchoClientTest {
}

@Test
public void echoTest7() {
public void echoTest7() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -331,7 +331,7 @@ public class EchoClientTest {
}

@Test
public void expandTest() {
public void expandTest() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -371,7 +371,7 @@ public class EchoClientTest {
}

@Test
public void collectTest() {
public void collectTest() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -426,7 +426,7 @@ public class EchoClientTest {
}

@Test
public void chatTest() {
public void chatTest() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -481,7 +481,7 @@ public class EchoClientTest {
}

@Test
public void chatAgainTest() {
public void chatAgainTest() throws Exception {
EchoResponse expectedResponse =
EchoResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down Expand Up @@ -536,7 +536,7 @@ public class EchoClientTest {
}

@Test
public void pagedExpandTest() {
public void pagedExpandTest() throws Exception {
EchoResponse responsesElement = EchoResponse.newBuilder().build();
PagedExpandResponse expectedResponse =
PagedExpandResponse.newBuilder()
Expand Down Expand Up @@ -592,7 +592,7 @@ public class EchoClientTest {
}

@Test
public void waitTest() {
public void waitTest() throws Exception {
WaitResponse expectedResponse =
WaitResponse.newBuilder().setContent("content951530617").build();
Operation resultOperation =
Expand Down Expand Up @@ -636,7 +636,7 @@ public class EchoClientTest {
}

@Test
public void waitTest2() {
public void waitTest2() throws Exception {
WaitResponse expectedResponse =
WaitResponse.newBuilder().setContent("content951530617").build();
Operation resultOperation =
Expand Down Expand Up @@ -680,7 +680,7 @@ public class EchoClientTest {
}

@Test
public void blockTest() {
public void blockTest() throws Exception {
BlockResponse expectedResponse =
BlockResponse.newBuilder().setContent("content951530617").build();
mockEcho.addResponse(expectedResponse);
Expand Down
Loading