Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery Error Message Changes #1483

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = "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";
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 '_'.
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.
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
Loading