use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeBoolArrayEmpty.
@Test
public void writeBoolArrayEmpty() {
write(baseInsert().set("BoolArrayValue").toBoolArray(new boolean[] {}).build());
Struct row = readLastRow("BoolArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBooleanList(0)).containsExactly();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeStringArrayNull.
@Test
public void writeStringArrayNull() {
write(baseInsert().set("StringArrayValue").toStringArray(null).build());
Struct row = readLastRow("StringArrayValue");
assertThat(row.isNull(0)).isTrue();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeBoolArrayNoNulls.
@Test
public void writeBoolArrayNoNulls() {
write(baseInsert().set("BoolArrayValue").toBoolArray(Arrays.asList(true, false)).build());
Struct row = readLastRow("BoolArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBooleanArray(0)).isEqualTo(new boolean[] { true, false });
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeStringNull.
@Test
public void writeStringNull() {
write(baseInsert().set("StringValue").to((String) null).build());
Struct row = readLastRow("StringValue");
assertThat(row.isNull(0)).isTrue();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeDateNull.
@Test
public void writeDateNull() {
write(baseInsert().set("DateValue").to((Date) null).build());
Struct row = readLastRow("DateValue");
assertThat(row.isNull(0)).isTrue();
}
Aggregations