ColumnSegment implements ExpressionSegment, OwnerAvailable { public String getQualifiedName() { return null == owner ? identifier.getValueWithQuoteCharacters() : String.join(".", owner.getIdentifier().getValueWithQuoteCharacters(), identifier.getValueWithQuoteCharacters()); }  String getQualifiedName(); @Override Optional<OwnerSegment> getOwner();  }
@Test public void assertGetQualifiedNameWithoutOwner() { ColumnSegment actual = new ColumnSegment(0, 0, new IdentifierValue("col")); assertThat(actual.getQualifiedName(), is("col")); }
@Test public void assertGetQualifiedNameWithoutOwner2() { ColumnSegment actual = new ColumnSegment(0, 0, new IdentifierValue("`col`")); assertThat(actual.getQualifiedName(), is("`col`")); }
@Test public void assertGetQualifiedNameWithOwner() { ColumnSegment actual = new ColumnSegment(0, 0, new IdentifierValue("col")); actual.setOwner(new OwnerSegment(0, 0, new IdentifierValue("tbl"))); assertThat(actual.getQualifiedName(), is("tbl.col")); }
@Test public void assertGetQualifiedNameWithOwner2() { ColumnSegment actual = new ColumnSegment(0, 0, new IdentifierValue("`col`")); actual.setOwner(new OwnerSegment(0, 0, new IdentifierValue("tbl"))); assertThat(actual.getQualifiedName(), is("tbl.`col`")); }
@Test public void assertGetQualifiedNameWithOwner3() { ColumnSegment actual = new ColumnSegment(0, 0, new IdentifierValue("col")); actual.setOwner(new OwnerSegment(0, 0, new IdentifierValue("`tbl`"))); assertThat(actual.getQualifiedName(), is("`tbl`.col")); }
@Test public void assertGetQualifiedNameWithOwner4() { ColumnSegment actual = new ColumnSegment(0, 0, new IdentifierValue("`col`")); actual.setOwner(new OwnerSegment(0, 0, new IdentifierValue("`tbl`"))); assertThat(actual.getQualifiedName(), is("`tbl`.`col`")); }