Skip to content

Commit

Permalink
Statement reserialization test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mairbek Khadikov committed Jun 3, 2017
1 parent 893d9f1 commit 8210ee3
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static com.google.common.testing.SerializableTester.reserializeAndAssert;
import static com.google.common.truth.Truth.assertThat;

import com.google.cloud.ByteArray;
import com.google.common.collect.ImmutableMap;
import com.google.common.testing.EqualsTester;
import org.junit.Rule;
Expand All @@ -42,6 +43,19 @@ public void basic() {
reserializeAndAssert(stmt);
}

@Test
public void serialization() throws Exception {
Statement stmt = Statement.newBuilder("SELECT * FROM table WHERE ")
.append("bool_field = @bool_field ").bind("bool_field").to(true)
.append("long_field = @long_field ").bind("long_field").to(1L)
.append("float_field = @float_field ").bind("float_field").to(1.)
.append("string_field = @string_field ").bind("string_field").to("abc")
.append("bytes_field = @bytes_field ").bind("bytes_field")
.to(ByteArray.fromBase64("abcd"))
.build();
reserializeAndAssert(stmt);
}

@Test
public void append() {
Statement stmt =
Expand Down

0 comments on commit 8210ee3

Please sign in to comment.