Skip to content

Commit

Permalink
BigQuery Error Message Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitCLI committed Jan 11, 2025
1 parent b8ca08a commit d1e0108
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,25 @@ public void verifyTheBigQueryValidationErrorMessageForInvalidProperty(String pro
expectedErrorMessage = PluginPropertyUtils
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_CHUNKSIZE);
} else if (property.equalsIgnoreCase("bucket")) {
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidTemporaryBucket");
expectedErrorMessage = PluginPropertyUtils
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_TEMPORARY_BUCKET);
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_TEMPORARY_BUCKET)
.replace("VALUE", propertyValue);
} else if (property.equalsIgnoreCase("table")) {
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidSinkTable");
expectedErrorMessage = PluginPropertyUtils
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_TABLE_NAME);
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_TABLE_NAME)
.replace("VALUE", propertyValue);
} else if (property.equalsIgnoreCase("dataset")) {
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidSinkDataset");
expectedErrorMessage = PluginPropertyUtils
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_DATASET_NAME)
.replace("VALUE", propertyValue);
} else {
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidPropertyValue");
expectedErrorMessage = PluginPropertyUtils.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_PROPERTY).
replaceAll("PROPERTY", property.substring(0, 1).toUpperCase() + property.substring(1));
replaceAll("PROPERTY", property.substring(0, 1).toUpperCase() + property.substring(1))
.replace("VALUE", propertyValue);
}
String actualErrorMessage = PluginPropertyUtils.findPropertyErrorElement(property).getText();
Assert.assertEquals(expectedErrorMessage, actualErrorMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* E2E Test constants.
*/
public class E2ETestConstants {
public static final String ERROR_MSG_INCORRECT_DATASET_NAME = "errorMessageInvalidDatasetName";
public static final String ERROR_MSG_GCS_INVALID_PATH = "errorMessageGCSInvalidPath";
public static final String ERROR_MSG_GCS_INVALID_BUCKET_NAME = "errorMessageGCSInvalidBucketName";
public static final String ERROR_MSG_INCORRECT_TABLE = "errorMessageIncorrectBQTable";
Expand Down
7 changes: 4 additions & 3 deletions src/e2e-test/resources/errorMessage.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ errorMessagePubSubDelayThresholdField=Invalid delay threshold for publishing a b
errorMessagePubSubRetryTimeout=Invalid max retry timeout for retrying failed publish. Ensure the value is a positive number.
errorMessagePubSubErrorThreshold=Invalid error threshold for publishing. Ensure the value is a positive number.
errorMessageIncorrectBQChunkSize=Value must be a multiple of 262144.
errorMessageIncorrectBQBucketName=Bucket name can only contain lowercase letters, numbers, '.', '_', and '-'.
errorMessageIncorrectBQTableName=Table name can only contain letters (lower or uppercase), numbers, '_' and '-'.
errorMessageIncorrectBQProperty=PROPERTY name can only contain letters (lower or uppercase), numbers and '_'.
errorMessageIncorrectBQBucketName=Bucket name 'VALUE' can only contain lowercase letters, numbers, '.', '_', and '-'.
errorMessageIncorrectBQTableName=Table name 'VALUE' can only contain letters (lower or uppercase), numbers, '_' and '-'.
errorMessageIncorrectBQProperty=PROPERTY name 'VALUE' can only contain letters (lower or uppercase), numbers and '_'.
errorMessageInvalidDatasetName=Dataset name 'VALUE' can only contain letters (lower or uppercase), numbers and '_'.
errorMessageInvalidPath=Error when trying to detect schema: Input path not found
errorMessageBQExecuteTableDataset=Dataset and table must be specified together.
errorMessageIncorrectMinimumSplitSize=Unable to create config for batchsource GCSFile 'minSplitSize' is invalid: Value of field class io.cdap.plugin.gcp.gcs.source.GCSSource$GCSSourceConfig.minSplitSize is expected to be a number.
Expand Down
1 change: 1 addition & 0 deletions src/e2e-test/resources/pluginParameters.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ bqChunkSize=262144
bqInvalidChunkSize=26214
bqInvalidSinkDataset=$#%$
bqInvalidSinkTable=(*^*&*
bqInvalidPropertyValue=$#%^&
bqInvalidTemporaryBucket=$#%$
bqInvalidRefName=invalidRef&^*&&*
bqDatatypeChange1=[{"key":"Id","value":"long"},{"key":"Value","value":"long"}]
Expand Down

0 comments on commit d1e0108

Please sign in to comment.