Set<SourceName> analyzeExpression(
      final Expression expression,
      final String clauseType
  ) {
    final Validator extractor = new Validator(clauseType);
    extractor.process(expression, null);
    return extractor.referencedSources;
  }
@Test
  public void shouldThrowOnNoSources() {
    // Given:
    final Expression expression = new UnqualifiedColumnReferenceExp(
        ColumnName.of("just-name")
    );

    when(sourceSchemas.sourcesWithField(any(), any()))
        .thenReturn(ImmutableSet.of());

    // When:
    final Exception e = assertThrows(
        UnknownColumnException.class,
        () -> analyzer.analyzeExpression(expression, CLAUSE_TYPE)
    );

    // Then:
    assertThat(e.getMessage(), containsString(
        CLAUSE_TYPE + " column 'just-name' cannot be resolved."));
  }