Skip to content

Commit

Permalink
Update YamlFederatedMetaStoreStorageTest.java
Browse files Browse the repository at this point in the history
fixing test
  • Loading branch information
patduin authored May 27, 2024
1 parent 5bd959c commit 23258d2
Showing 1 changed file with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public void saveFederationWriteFederations() throws Exception {
storage.insert(newFederatedInstance);
storage.saveFederation();
List<String> lines = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8);
assertThat(lines.size(), is(26));
assertThat(lines.size(), is(25));
assertThat(lines.get(0), is("primary-meta-store:"));
assertThat(lines.get(1), is(" access-control-type: READ_ONLY"));
assertThat(lines.get(2), is(" database-prefix: ''"));
Expand All @@ -227,22 +227,21 @@ public void saveFederationWriteFederations() throws Exception {
assertThat(lines.get(7), is("- access-control-type: READ_ONLY"));
assertThat(lines.get(8), is(" configuration-properties:"));
assertThat(lines.get(9), is(" hive.metastore.kerberos.principal: hive/_HOST@REALM"));
assertThat(lines.get(10), is(" database-name-mapping: {}"));
assertThat(lines.get(11), is(" database-prefix: hcom_2_"));
assertThat(lines.get(12), is(" hive-metastore-filter-hook: filter.hook.class"));
assertThat(lines.get(13), is(" latency: 0"));
assertThat(lines.get(14), is(" mapped-databases:"));
assertThat(lines.get(15), is(" - db1"));
assertThat(lines.get(16), is(" - db2"));
assertThat(lines.get(17), is(" mapped-tables:"));
assertThat(lines.get(18), is(" - database: db1"));
assertThat(lines.get(19), is(" mapped-tables:"));
assertThat(lines.get(20), is(" - tbl1"));
assertThat(lines.get(21), is(" - database: db2"));
assertThat(lines.get(22), is(" mapped-tables:"));
assertThat(lines.get(23), is(" - tbl2"));
assertThat(lines.get(24), is(" name: hcom_2"));
assertThat(lines.get(25), is(" remote-meta-store-uris: thrift://localhost:29083"));
assertThat(lines.get(10), is(" database-prefix: hcom_2_"));
assertThat(lines.get(11), is(" hive-metastore-filter-hook: filter.hook.class"));
assertThat(lines.get(12), is(" latency: 0"));
assertThat(lines.get(13), is(" mapped-databases:"));
assertThat(lines.get(14), is(" - db1"));
assertThat(lines.get(15), is(" - db2"));
assertThat(lines.get(16), is(" mapped-tables:"));
assertThat(lines.get(17), is(" - database: db1"));
assertThat(lines.get(18), is(" mapped-tables:"));
assertThat(lines.get(19), is(" - tbl1"));
assertThat(lines.get(20), is(" - database: db2"));
assertThat(lines.get(21), is(" mapped-tables:"));
assertThat(lines.get(22), is(" - tbl2"));
assertThat(lines.get(23), is(" name: hcom_2"));
assertThat(lines.get(24), is(" remote-meta-store-uris: thrift://localhost:29083"));
}

@Test
Expand Down Expand Up @@ -301,7 +300,7 @@ public void savePrimaryWriteFederations() throws Exception {
storage.insert(newFederatedInstance("hcom_2", "thrift://localhost:29083"));
storage.saveFederation();
List<String> lines = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8);
assertThat(lines.size(), is(25));
assertThat(lines.size(), is(24));
assertThat(lines.get(0), is("primary-meta-store:"));
assertThat(lines.get(1), is(" access-control-type: READ_ONLY"));
assertThat(lines.get(2), is(" configuration-properties:"));
Expand All @@ -322,11 +321,10 @@ public void savePrimaryWriteFederations() throws Exception {
assertThat(lines.get(17), is(" remote-meta-store-uris: thrift://localhost:19083"));
assertThat(lines.get(18), is("federated-meta-stores:"));
assertThat(lines.get(19), is("- access-control-type: READ_ONLY"));
assertThat(lines.get(20), is(" database-name-mapping: {}"));
assertThat(lines.get(21), is(" database-prefix: hcom_2_"));
assertThat(lines.get(22), is(" latency: 0"));
assertThat(lines.get(23), is(" name: hcom_2"));
assertThat(lines.get(24), is(" remote-meta-store-uris: thrift://localhost:29083"));
assertThat(lines.get(20), is(" database-prefix: hcom_2_"));
assertThat(lines.get(21), is(" latency: 0"));
assertThat(lines.get(22), is(" name: hcom_2"));
assertThat(lines.get(23), is(" remote-meta-store-uris: thrift://localhost:29083"));
}

private PrimaryMetaStore newPrimaryInstance(String name, String remoteMetaStoreUris) {
Expand Down

0 comments on commit 23258d2

Please sign in to comment.