@@ -90,18 +90,18 @@ public void getCountOfNoOfRecordsTransferredToTargetBigQueryTable() throws IOExc
9090 int countRecords = BigQueryClient .countBqQuery (TestSetupHooks .bqTargetTable );
9191 BeforeActions .scenario .write ("**********No of Records Transferred******************:" + countRecords );
9292 Assert .assertEquals ("Number of records transferred should be equal to records out " ,
93- countRecords , recordOut ());
93+ countRecords , recordOut ());
9494 }
9595
9696 @ Then ("Validate records transferred to target table is equal to number of records from source table " +
97- "with filter {string}" )
97+ "with filter {string}" )
9898 public void validateRecordsTransferredToTargetTableIsEqualToNumberOfRecordsFromSourceTableWithFilter (String filter )
99- throws IOException , InterruptedException {
99+ throws IOException , InterruptedException {
100100 String projectId = (PluginPropertyUtils .pluginProp ("projectId" ));
101101 String datasetName = (PluginPropertyUtils .pluginProp ("dataset" ));
102102 int countRecordsTarget = BigQueryClient .countBqQuery (TestSetupHooks .bqTargetTable );
103103 String selectQuery = "SELECT count(*) FROM `" + projectId + "." + datasetName + "." +
104- TestSetupHooks .bqTargetTable + "` WHERE " + PluginPropertyUtils .pluginProp (filter );
104+ TestSetupHooks .bqTargetTable + "` WHERE " + PluginPropertyUtils .pluginProp (filter );
105105 Optional <String > result = BigQueryClient .getSoleQueryResult (selectQuery );
106106 int count = result .map (Integer ::parseInt ).orElse (0 );
107107 BeforeActions .scenario .write ("Number of records transferred with respect to filter:" + count );
@@ -110,13 +110,13 @@ public void validateRecordsTransferredToTargetTableIsEqualToNumberOfRecordsFromS
110110
111111 @ Then ("Validate partition date in output partitioned table" )
112112 public void validatePartitionDateInOutputPartitionedTable ()
113- throws IOException , InterruptedException {
113+ throws IOException , InterruptedException {
114114 Optional <String > result = BigQueryClient
115- .getSoleQueryResult ("SELECT distinct _PARTITIONDATE as pt FROM `" +
116- (PluginPropertyUtils .pluginProp ("projectId" )) + "." +
117- (PluginPropertyUtils .pluginProp ("dataset" )) + "." +
118- TestSetupHooks .bqTargetTable +
119- "` WHERE _PARTITION_LOAD_TIME IS Not NULL ORDER BY _PARTITIONDATE DESC " );
115+ .getSoleQueryResult ("SELECT distinct _PARTITIONDATE as pt FROM `" +
116+ (PluginPropertyUtils .pluginProp ("projectId" )) + "." +
117+ (PluginPropertyUtils .pluginProp ("dataset" )) + "." +
118+ TestSetupHooks .bqTargetTable +
119+ "` WHERE _PARTITION_LOAD_TIME IS Not NULL ORDER BY _PARTITIONDATE DESC " );
120120 String outputDate = StringUtils .EMPTY ;
121121 if (result .isPresent ()) {
122122 outputDate = result .get ();
@@ -136,10 +136,10 @@ public void validateTheRecordsAreNotCreatedInOutputTable() throws IOException, I
136136 public void validatePartitioningIsNotDoneOnTheOutputTable () {
137137 try {
138138 BigQueryClient .getSoleQueryResult ("SELECT distinct _PARTITIONDATE as pt FROM `" +
139- (PluginPropertyUtils .pluginProp ("projectId" ))
140- + "." + (PluginPropertyUtils .pluginProp ("dataset" )) + "." +
141- TestSetupHooks .bqTargetTable
142- + "` WHERE _PARTITION_LOAD_TIME IS Not NULL " );
139+ (PluginPropertyUtils .pluginProp ("projectId" ))
140+ + "." + (PluginPropertyUtils .pluginProp ("dataset" )) + "." +
141+ TestSetupHooks .bqTargetTable
142+ + "` WHERE _PARTITION_LOAD_TIME IS Not NULL " );
143143 } catch (Exception e ) {
144144 String partitionException = e .toString ();
145145 Assert .assertTrue (partitionException .contains ("Unrecognized name: _PARTITION_LOAD_TIME" ));
@@ -168,8 +168,8 @@ public void validateTheCmekKeyOfTargetBigQueryTableIfCmekIsEnabled(String cmek)
168168 String cmekBQ = PluginPropertyUtils .pluginProp (cmek );
169169 if (cmekBQ != null ) {
170170 Assert .assertTrue ("Cmek key of target BigQuery table should be equal to " +
171- "cmek key provided in config file" ,
172- BigQueryClient .verifyCmekKey (TestSetupHooks .bqTargetTable , cmekBQ ));
171+ "cmek key provided in config file" ,
172+ BigQueryClient .verifyCmekKey (TestSetupHooks .bqTargetTable , cmekBQ ));
173173 return ;
174174 }
175175 BeforeActions .scenario .write ("CMEK not enabled" );
@@ -204,13 +204,13 @@ public void enterRuntimeArgumentValueForBigQueryCmekPropertyKeyIfBQCmekIsEnabled
204204
205205 @ Then ("Verify the partition table is created with partitioned on field {string}" )
206206 public void verifyThePartitionTableIsCreatedWithPartitionedOnField (String partitioningField ) throws IOException ,
207- InterruptedException {
207+ InterruptedException {
208208 Optional <String > result = BigQueryClient
209- .getSoleQueryResult ("SELECT IS_PARTITIONING_COLUMN FROM `" +
210- (PluginPropertyUtils .pluginProp ("projectId" )) + "."
211- + (PluginPropertyUtils .pluginProp ("dataset" )) + ".INFORMATION_SCHEMA.COLUMNS` " +
212- "WHERE table_name = '" + TestSetupHooks .bqTargetTable
213- + "' and column_name = '" + PluginPropertyUtils .pluginProp (partitioningField ) + "' " );
209+ .getSoleQueryResult ("SELECT IS_PARTITIONING_COLUMN FROM `" +
210+ (PluginPropertyUtils .pluginProp ("projectId" )) + "."
211+ + (PluginPropertyUtils .pluginProp ("dataset" )) + ".INFORMATION_SCHEMA.COLUMNS` " +
212+ "WHERE table_name = '" + TestSetupHooks .bqTargetTable
213+ + "' and column_name = '" + PluginPropertyUtils .pluginProp (partitioningField ) + "' " );
214214 String isPartitioningDoneOnField = StringUtils .EMPTY ;
215215 if (result .isPresent ()) {
216216 isPartitioningDoneOnField = result .get ();
@@ -230,7 +230,7 @@ public void verifyTheBigQueryValidationErrorMessageForInvalidProperty(String pro
230230 String expectedErrorMessage ;
231231 if (property .equalsIgnoreCase ("gcsChunkSize" )) {
232232 expectedErrorMessage = PluginPropertyUtils
233- .errorProp (E2ETestConstants .ERROR_MSG_BQ_INCORRECT_CHUNKSIZE );
233+ .errorProp (E2ETestConstants .ERROR_MSG_BQ_INCORRECT_CHUNKSIZE );
234234 } else if (property .equalsIgnoreCase ("bucket" )) {
235235 expectedErrorMessage = PluginPropertyUtils
236236 .errorProp (E2ETestConstants .ERROR_MSG_BQ_INCORRECT_TEMPORARY_BUCKET );
@@ -239,7 +239,7 @@ public void verifyTheBigQueryValidationErrorMessageForInvalidProperty(String pro
239239 .errorProp (E2ETestConstants .ERROR_MSG_INCORRECT_TABLE_NAME );
240240 } else {
241241 expectedErrorMessage = PluginPropertyUtils .errorProp (E2ETestConstants .ERROR_MSG_BQ_INCORRECT_PROPERTY ).
242- replaceAll ("PROPERTY" , property .substring (0 , 1 ).toUpperCase () + property .substring (1 ));
242+ replaceAll ("PROPERTY" , property .substring (0 , 1 ).toUpperCase () + property .substring (1 ));
243243 }
244244 String actualErrorMessage = PluginPropertyUtils .findPropertyErrorElement (property ).getText ();
245245 Assert .assertEquals (expectedErrorMessage , actualErrorMessage );
@@ -250,20 +250,15 @@ public void verifyTheBigQueryValidationErrorMessageForInvalidProperty(String pro
250250
251251 @ Then ("Validate records transferred to target table is equal to number of records from source table" )
252252 public void validateRecordsTransferredToTargetTableIsEqualToNumberOfRecordsFromSourceTable ()
253- throws IOException , InterruptedException {
253+ throws IOException , InterruptedException {
254254 int countRecordsTarget = BigQueryClient .countBqQuery (TestSetupHooks .bqTargetTable );
255255 Optional <String > result = BigQueryClient .getSoleQueryResult ("SELECT count(*) FROM `" +
256- (PluginPropertyUtils .pluginProp ("projectId" ))
257- + "." + (PluginPropertyUtils .pluginProp
258- ("dataset" )) + "." + TestSetupHooks .bqTargetTable + "` " );
256+ (PluginPropertyUtils .pluginProp ("projectId" ))
257+ + "." + (PluginPropertyUtils .pluginProp
258+ ("dataset" )) + "." + TestSetupHooks .bqTargetTable + "` " );
259259 int count = result .map (Integer ::parseInt ).orElse (0 );
260260 BeforeActions .scenario .write ("Number of records transferred from source table to target table:" + count );
261261 Assert .assertEquals (count , countRecordsTarget );
262262 }
263263
264- @ Then ("Enter BigQuery source properties filter" )
265- public void enterBigQuerysourcePropertiesfilter () throws IOException {
266- CdfBigQueryPropertiesActions .enterFilter ("%%%%" );
267- }
268-
269264}
0 commit comments