Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Feb 22, 2024
1 parent 3c3e00c commit 2e86c0b
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ void rewritePushdownQueryEscapesSingleQuotes() throws AdapterException, SQLExcep
+ " STATEMENT 'string '' with '''' quotes \"...'"));
}

@Test
void generateImportStatement() throws SQLException {
final Connection connectionMock = mockConnection();
when(connectionFactoryMock.getConnection()).thenReturn(connectionMock);
final AdapterProperties properties = createAdapterProperties();
final SqlDialect dialect = new ExasolSqlDialect(connectionFactoryMock, properties);
final ExasolFromExaWithDataTypeQueryRewriter queryRewriter = new ExasolFromExaWithDataTypeQueryRewriter(dialect,
new ExasolMetadataReader(connectionMock, properties), connectionFactoryMock);
assertThat(queryRewriter.generateImportStatement("connection", "pushdownQuery"),
equalTo("IMPORT INTO (c1 DECIMAL(18, 0)) FROM EXA connection STATEMENT 'pushdownQuery'"));
}

protected Connection mockConnection() throws SQLException {
final ResultSetMetaData metadataMock = mock(ResultSetMetaData.class);
when(metadataMock.getColumnCount()).thenReturn(1);
Expand Down

0 comments on commit 2e86c0b

Please sign in to comment.