Skip to content

Commit

Permalink
add unit test for append rows without schema
Browse files Browse the repository at this point in the history
  • Loading branch information
yayi-google committed Feb 26, 2021
1 parent afff8ea commit e8a3c63
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -253,6 +253,22 @@ public void testAppendWithMessageSuccess() throws Exception {
writer.close();
}

@Test
public void testAppendWithRowsNoSchema() throws Exception {
final StreamWriterV2 writer = getTestStreamWriterV2();
StatusRuntimeException ex =
assertThrows(
StatusRuntimeException.class,
new ThrowingRunnable() {
@Override
public void run() throws Throwable {
writer.append(createProtoRows(new String[] {"A"}), -1);
}
});
assertEquals(ex.getStatus().getCode(), Status.INVALID_ARGUMENT.getCode());
assertTrue(ex.getStatus().getDescription().contains("Writer schema must be provided"));
}

@Test
public void testAppendSuccessAndConnectionError() throws Exception {
StreamWriterV2 writer = getTestStreamWriterV2();
Expand Down

0 comments on commit e8a3c63

Please sign in to comment.