### Question:
HMSClient implements AutoCloseable { Database getDatabase(@NotNull String dbName) throws TException { return client.get_database(dbName); } HMSClient(@Nullable URI uri);   HMSClient(@Nullable URI uri, @Nullable String confDir); URI getServerURI(); @Override String toString(); boolean dropPartition(@NotNull String dbName, @NotNull String tableName,
                               @NotNull List<String> arguments); @Override void close();  }### Answer:
@Test public void getDatabase() throws TException { Database db = client.getDatabase(TEST_DATABASE); MatcherAssert.assertThat(db.getName(), Matchers.equalToIgnoringCase(TEST_DATABASE)); MatcherAssert.assertThat(db.getDescription(), Matchers.equalTo(TEST_DATABASE_DESCRIPTION)); MatcherAssert.assertThat(db.getParameters(), Matchers.equalTo(TEST_DATABASE_PARAMS)); MatcherAssert.assertThat(db.getLocationUri(), Matchers.containsString(TEST_DATABASE.toLowerCase())); }
@Test public void getDatabaseCI() throws TException { Database db = client.getDatabase(TEST_DATABASE.toUpperCase()); MatcherAssert.assertThat(db.getName(), Matchers.equalToIgnoringCase(TEST_DATABASE)); MatcherAssert.assertThat(db.getDescription(), Matchers.equalTo(TEST_DATABASE_DESCRIPTION)); MatcherAssert.assertThat(db.getParameters(), Matchers.equalTo(TEST_DATABASE_PARAMS)); MatcherAssert.assertThat(db.getLocationUri(), Matchers.containsString(TEST_DATABASE.toLowerCase())); }
@Test public void getNonExistingDb() { Throwable exception = Assertions.assertThrows(NoSuchObjectException.class, () -> client.getDatabase("WhatIsThisDatabase")); }