File tree Expand file tree Collapse file tree
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import static com .google .common .testing .SerializableTester .reserializeAndAssert ;
2020import static com .google .common .truth .Truth .assertThat ;
2121
22+ import com .google .cloud .ByteArray ;
2223import com .google .common .collect .ImmutableMap ;
2324import com .google .common .testing .EqualsTester ;
2425import org .junit .Rule ;
@@ -42,6 +43,19 @@ public void basic() {
4243 reserializeAndAssert (stmt );
4344 }
4445
46+ @ Test
47+ public void serialization () throws Exception {
48+ Statement stmt = Statement .newBuilder ("SELECT * FROM table WHERE " )
49+ .append ("bool_field = @bool_field " ).bind ("bool_field" ).to (true )
50+ .append ("long_field = @long_field " ).bind ("long_field" ).to (1L )
51+ .append ("float_field = @float_field " ).bind ("float_field" ).to (1. )
52+ .append ("string_field = @string_field " ).bind ("string_field" ).to ("abc" )
53+ .append ("bytes_field = @bytes_field " ).bind ("bytes_field" )
54+ .to (ByteArray .fromBase64 ("abcd" ))
55+ .build ();
56+ reserializeAndAssert (stmt );
57+ }
58+
4559 @ Test
4660 public void append () {
4761 Statement stmt =
You can’t perform that action at this time.
0 commit comments