@Test
public void testConvertSqlWithStrictLimitOffset() throws SQLException, SqlParseException {

    DataSourceDefProvider provider = DataSourceDefProvider.getInstance();
    ConvMaster master = new ConvMaster(provider.getDefault(), provider.getById(TEST_TARGET));
    SqlConverter converter = new SqlConverter(new SqlConverter.IConfigurer() {
        @Override
        public boolean skipDefaultConvert() {
            return false;
        }
        @Override
        public boolean skipHandleDefault() {
            return false;
        }
        @Override
        public boolean useUppercaseDefault() {
            return true;
        }
        @Override
        public String fixAfterDefaultConvert(String orig) {
            return orig;
        }
        @Override
        public SqlDialect getSqlDialect() {
            return SqlDialect.CALCITE;
        }
        @Override
        public boolean allowNoOffset() {
            return false;
        }
        @Override
        public boolean allowFetchNoRows() {
            return false;
        }
        @Override
        public boolean allowNoOrderByWithFetch() {
            return false;
        }
        @Override
        public String getPagingType() {
            return "AUTO";
        }
        @Override
        public boolean isCaseSensitive() {
            return false;
        }
        @Override
        public boolean enableCache() {
            return true;
        }
        @Override
        public boolean enableQuote() {
            return true;
        }
        @Override
        public String fixIdentifierCaseSensitve(String orig) {
            return orig;
        }
        @Override
        public String getTransactionIsolationLevel() {
            return null;
        }
    }, master);
    Assert.assertEquals("SELECT 1\nORDER BY 2\nOFFSET 0 ROWS\nFETCH NEXT 1 ROWS ONLY",
            converter.convertSql("SELECT 1 ORDER BY 2 LIMIT 1"));
    Assert.assertEquals("SELECT 1\nORDER BY 1\nOFFSET 0 ROWS\nFETCH NEXT 1 ROWS ONLY",
            converter.convertSql("SELECT 1 ORDER BY 1 LIMIT 1"));
    Assert.assertEquals("SELECT 1\nORDER BY \"COL\"\nOFFSET 0 ROWS\nFETCH NEXT 1 ROWS ONLY",
            converter.convertSql("SELECT 1 ORDER BY COL LIMIT 1"));
    Assert.assertEquals("SELECT 1\nORDER BY 1\nOFFSET 0 ROWS\nFETCH NEXT 1 ROWS ONLY",
            converter.convertSql("SELECT 1 ORDER BY 1 LIMIT 0"));
    Assert.assertEquals("SELECT 1\nORDER BY 1\nOFFSET 1 ROWS\nFETCH NEXT 1 ROWS ONLY",
            converter.convertSql("SELECT 1 ORDER BY 1 LIMIT 1 OFFSET 1"));
    Assert.assertEquals("SELECT 1\nORDER BY 1\nOFFSET 0 ROWS\nFETCH NEXT 1 ROWS ONLY",
            converter.convertSql("SELECT 1 LIMIT 1"));
}