diff --git a/src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BigQueryBase.java b/src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BigQueryBase.java index d4ae865c8a..a28c116123 100644 --- a/src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BigQueryBase.java +++ b/src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BigQueryBase.java @@ -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); diff --git a/src/e2e-test/java/io/cdap/plugin/utils/E2ETestConstants.java b/src/e2e-test/java/io/cdap/plugin/utils/E2ETestConstants.java index 4fb86da3b4..767cd362c0 100644 --- a/src/e2e-test/java/io/cdap/plugin/utils/E2ETestConstants.java +++ b/src/e2e-test/java/io/cdap/plugin/utils/E2ETestConstants.java @@ -4,6 +4,7 @@ * E2E Test constants. */ public class E2ETestConstants { + public static final String ERROR_MSG_INCORRECT_DATASET_NAME = "errorMessageIncorrectDatasetName"; 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"; diff --git a/src/e2e-test/resources/errorMessage.properties b/src/e2e-test/resources/errorMessage.properties index bd8a1610b9..45ce14b7de 100644 --- a/src/e2e-test/resources/errorMessage.properties +++ b/src/e2e-test/resources/errorMessage.properties @@ -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 '_'. +errorMessageIncorrectDatasetName=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. diff --git a/src/e2e-test/resources/pluginParameters.properties b/src/e2e-test/resources/pluginParameters.properties index 2c64e16f2f..b89e3c9515 100644 --- a/src/e2e-test/resources/pluginParameters.properties +++ b/src/e2e-test/resources/pluginParameters.properties @@ -216,6 +216,7 @@ bqChunkSize=262144 bqInvalidChunkSize=26214 bqInvalidSinkDataset=$#%$ bqInvalidSinkTable=(*^*&* +bqInvalidPropertyValue=$#%^& bqInvalidTemporaryBucket=$#%$ bqInvalidRefName=invalidRef&^*&&* bqDatatypeChange1=[{"key":"Id","value":"long"},{"key":"Value","value":"long"}]