@Test
  public void testDatabaseAndNamespaceWithLocation() throws Exception {
    Namespace namespace1 = Namespace.of("noLocation");
    catalog.createNamespace(namespace1, meta);
    Database database1 =
        HIVE_METASTORE_EXTENSION.metastoreClient().getDatabase(namespace1.toString());

    assertThat(database1.getParameters()).containsEntry("owner", "apache");
    assertThat(database1.getParameters()).containsEntry("group", "iceberg");

    assertThat(defaultUri(namespace1))
        .as("There no same location for db and namespace")
        .isEqualTo(database1.getLocationUri());

    assertThatThrownBy(() -> catalog.createNamespace(namespace1))
        .isInstanceOf(AlreadyExistsException.class)
        .hasMessage(String.format("Namespace already exists: %s", namespace1));
    String hiveLocalDir = temp.toFile().toURI().toString();
    // remove the trailing slash of the URI
    hiveLocalDir = hiveLocalDir.substring(0, hiveLocalDir.length() - 1);
    ImmutableMap newMeta = ImmutableMap.<String, String>builder()
        .putAll(meta)
        .put("location", hiveLocalDir)
        .build();
    Namespace namespace2 = Namespace.of("haveLocation");

    catalog.createNamespace(namespace2, newMeta);
    Database database2 =
        HIVE_METASTORE_EXTENSION.metastoreClient().getDatabase(namespace2.toString());
    assertThat(hiveLocalDir)
        .as("There no same location for db and namespace")
        .isEqualTo(database2.getLocationUri());
  }
Run all the tests from abstract of {@link CatalogTests} with few specific tests related to HIVE.
iceberg/iceberg-catalog/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java