@Override
  public boolean dropNamespace(Namespace namespace) throws NamespaceNotEmptyException {
    if (!namespace.isEmpty() && !namespaceExists(namespace)) {
      throw new NoSuchNamespaceException("Namespace %s does not exist", namespace);
    }

    if (!listNamespaces(namespace).isEmpty() || !listTables(namespace).isEmpty()) {
      throw new NamespaceNotEmptyException("Namespace %s is not empty", namespace);
    }

    EcsURI namespaceObject = namespaceURI(namespace);
    client.deleteObject(namespaceObject.bucket(), namespaceObject.name());
    LOG.info("Dropped namespace: {}", namespace);
    return true;
  }
@Test
  public void testDropNamespace() {
    ecsCatalog.createNamespace(Namespace.of("a"));
    ecsCatalog.createNamespace(Namespace.of("a", "b1"));
    ecsCatalog.createTable(TableIdentifier.of("a", "t1"), SCHEMA);

    assertThatThrownBy(() -> ecsCatalog.dropNamespace(Namespace.of("unknown")))
        .isInstanceOf(NoSuchNamespaceException.class)
        .hasMessage("Namespace unknown does not exist");

    assertThatThrownBy(() -> ecsCatalog.dropNamespace(Namespace.of("a")))
        .isInstanceOf(NamespaceNotEmptyException.class)
        .hasMessage("Namespace a is not empty");

    assertThat(ecsCatalog.dropNamespace(Namespace.of("a", "b1")))
        .as("Drop namespace [a, b1]")
        .isTrue();

    assertThat(ecsCatalog.namespaceExists(Namespace.of("a", "b1")))
        .as("The [a, b1] is absent")
        .isFalse();
    assertThat(ecsCatalog.listNamespaces(Namespace.of("a")))
        .as("The [a, b1] is not in list result of [a]")
        .isEmpty();
  }