public DdlCommandResult execute(
      final String sql,
      final DdlCommand ddlCommand,
      final boolean withQuery,
      final Set<SourceName> withQuerySources
  ) {
    return execute(sql, ddlCommand, withQuery, withQuerySources, false);
  }
@Test
  public void shouldThrowOnDropTableWhenConstraintExist() {
    // Given:
    final CreateTableCommand table1 = buildCreateTable(SourceName.of("t1"),
        false, false);
    final CreateTableCommand table2 = buildCreateTable(SourceName.of("t2"),
        false, false);
    final CreateTableCommand table3 = buildCreateTable(SourceName.of("t3"),
        false, false);
    cmdExec.execute(SQL_TEXT, table1, true, Collections.emptySet());
    cmdExec.execute(SQL_TEXT, table2, true, Collections.singleton(SourceName.of("t1")));
    cmdExec.execute(SQL_TEXT, table3, true, Collections.singleton(SourceName.of("t1")));

    // When:
    final DropSourceCommand dropStream = buildDropSourceCommand(SourceName.of("t1"));
    final Exception e = assertThrows(
        KsqlReferentialIntegrityException.class,
        () -> cmdExec.execute(SQL_TEXT, dropStream, false, Collections.emptySet())
    );

    // Then:
    assertThat(e.getMessage(),
        containsString("Cannot drop t1."));
    assertThat(e.getMessage(),
        containsString("The following streams and/or tables read from this source: [t2, t3]."));
    assertThat(e.getMessage(),
        containsString("You need to drop them before dropping t1."));
  }