    @Test
    public void testGenerateSqlForExportCompression() {


        ExaExportSpecification exportSpec = mock(ExaExportSpecification.class);
        ExaMetadata meta = mock(ExaMetadata.class);
        when(meta.getScriptSchema()).thenReturn("hcat_schema");

        Map<String, String> params = new HashMap<>();
        addMandatoryParams(params);
        params.put("COMPRESSION_TYPE", "snappy");
        when(exportSpec.getParameters()).thenReturn(params);

        when(exportSpec.hasConnectionInformation()).thenReturn(false);
        when(exportSpec.hasConnectionName()).thenReturn(false);
        when(exportSpec.hasTruncate()).thenReturn(false);
        when(exportSpec.hasReplace()).thenReturn(false);
        when(exportSpec.hasCreatedBy()).thenReturn(false);

        List<String> colNames = new ArrayList<>();
        colNames.add("COL1");
        when(exportSpec.getSourceColumnNames()).thenReturn(colNames);

        String sql = ExportHCatTable.generateSqlForExportSpec(meta, exportSpec);
        sql = normalizeSql(sql);

        String sqlExpected = "SELECT"
                + " \"" + meta.getScriptSchema() +"\".\"EXPORT_INTO_HIVE_TABLE\"("
                + "'hcat_db', 'hcat_table', '', 'hdfs_user', 'hcat_user', '', '', '', '', '', 'snappy', 'false', ''"
                + ", \"COL1\""
                + ") "
                + "FROM "
                + "DUAL;";
        sqlExpected = normalizeSql(sqlExpected);

        assertEquals(sqlExpected, sql);

        verify(exportSpec, never()).hasConnectionName();
        verify(exportSpec, never()).getConnectionName();
        verify(exportSpec, never()).hasConnectionInformation();
        verify(exportSpec, never()).getConnectionInformation();
        verify(exportSpec, atLeastOnce()).getParameters();
        verify(exportSpec, atLeastOnce()).hasTruncate();
        verify(exportSpec, atLeastOnce()).hasReplace();
        verify(exportSpec, atLeastOnce()).hasCreatedBy();
        verify(exportSpec, never()).getCreatedBy();
        verify(exportSpec, atLeastOnce()).getSourceColumnNames();
    }