Skip to content

Commit

Permalink
Fix unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hengfengli committed Oct 30, 2024
1 parent 2a12276 commit 16caba6
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void simple() {

List<Schema.Field> fields = avroSchema.getFields();

assertThat(fields, hasSize(8));
assertThat(fields, hasSize(9));

assertThat(fields.get(0).name(), equalTo("id"));
// Not null
Expand Down Expand Up @@ -247,15 +247,15 @@ public void simple() {
assertThat(fields.get(7).getProp(SPANNER_SEQUENCE_SKIP_RANGE_MIN), equalTo("2000"));
assertThat(fields.get(7).getProp(SPANNER_SEQUENCE_SKIP_RANGE_MAX), equalTo("3000"));

assertThat(fields.get(7).name(), equalTo("identity_column_no_kind"));
assertThat(fields.get(7).schema(), equalTo(nullableUnion(Schema.Type.LONG)));
assertThat(fields.get(7).getProp(SQL_TYPE), equalTo("INT64"));
assertThat(fields.get(7).getProp(NOT_NULL), equalTo(null));
assertThat(fields.get(7).getProp(IDENTITY_COLUMN), equalTo("true"));
assertThat(fields.get(7).getProp(SPANNER_SEQUENCE_KIND), equalTo(null));
assertThat(fields.get(7).getProp(SPANNER_SEQUENCE_COUNTER_START), equalTo("1000"));
assertThat(fields.get(7).getProp(SPANNER_SEQUENCE_SKIP_RANGE_MIN), equalTo("2000"));
assertThat(fields.get(7).getProp(SPANNER_SEQUENCE_SKIP_RANGE_MAX), equalTo("3000"));
assertThat(fields.get(8).name(), equalTo("identity_column_no_kind"));
assertThat(fields.get(8).schema(), equalTo(nullableUnion(Schema.Type.LONG)));
assertThat(fields.get(8).getProp(SQL_TYPE), equalTo("INT64"));
assertThat(fields.get(8).getProp(NOT_NULL), equalTo(null));
assertThat(fields.get(8).getProp(IDENTITY_COLUMN), equalTo("true"));
assertThat(fields.get(8).getProp(SPANNER_SEQUENCE_KIND), equalTo(null));
assertThat(fields.get(8).getProp(SPANNER_SEQUENCE_COUNTER_START), equalTo("1000"));
assertThat(fields.get(8).getProp(SPANNER_SEQUENCE_SKIP_RANGE_MIN), equalTo("2000"));
assertThat(fields.get(8).getProp(SPANNER_SEQUENCE_SKIP_RANGE_MAX), equalTo("3000"));

// spanner pk
assertThat(avroSchema.getProp(SPANNER_PRIMARY_KEY + "_0"), equalTo("`id` ASC"));
Expand Down

0 comments on commit 16caba6

Please sign in to comment.