Skip to content

Commit c9b40d9

Browse files
committed
BigQuery Error Message Changes
1 parent b8ca08a commit c9b40d9

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BigQueryBase.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,25 @@ public void verifyTheBigQueryValidationErrorMessageForInvalidProperty(String pro
232232
expectedErrorMessage = PluginPropertyUtils
233233
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_CHUNKSIZE);
234234
} else if (property.equalsIgnoreCase("bucket")) {
235+
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidTemporaryBucket");
235236
expectedErrorMessage = PluginPropertyUtils
236-
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_TEMPORARY_BUCKET);
237+
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_TEMPORARY_BUCKET)
238+
.replace("VALUE", propertyValue);
237239
} else if (property.equalsIgnoreCase("table")) {
240+
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidSinkTable");
238241
expectedErrorMessage = PluginPropertyUtils
239-
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_TABLE_NAME);
242+
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_TABLE_NAME)
243+
.replace("VALUE", propertyValue);
244+
} else if (property.equalsIgnoreCase("dataset")) {
245+
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidSinkDataset");
246+
expectedErrorMessage = PluginPropertyUtils
247+
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_DATASET_NAME)
248+
.replace("VALUE", propertyValue);
240249
} else {
250+
String propertyValue = PluginPropertyUtils.pluginProp("bqInvalidPropertyValue");
241251
expectedErrorMessage = PluginPropertyUtils.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_PROPERTY).
242-
replaceAll("PROPERTY", property.substring(0, 1).toUpperCase() + property.substring(1));
252+
replaceAll("PROPERTY", property.substring(0, 1).toUpperCase() + property.substring(1))
253+
.replace("VALUE", propertyValue);
243254
}
244255
String actualErrorMessage = PluginPropertyUtils.findPropertyErrorElement(property).getText();
245256
Assert.assertEquals(expectedErrorMessage, actualErrorMessage);

src/e2e-test/java/io/cdap/plugin/utils/E2ETestConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* E2E Test constants.
55
*/
66
public class E2ETestConstants {
7+
public static final String ERROR_MSG_INCORRECT_DATASET_NAME = "errorMessageIncorrectDatasetName";
78
public static final String ERROR_MSG_GCS_INVALID_PATH = "errorMessageGCSInvalidPath";
89
public static final String ERROR_MSG_GCS_INVALID_BUCKET_NAME = "errorMessageGCSInvalidBucketName";
910
public static final String ERROR_MSG_INCORRECT_TABLE = "errorMessageIncorrectBQTable";

src/e2e-test/resources/errorMessage.properties

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ errorMessagePubSubDelayThresholdField=Invalid delay threshold for publishing a b
1414
errorMessagePubSubRetryTimeout=Invalid max retry timeout for retrying failed publish. Ensure the value is a positive number.
1515
errorMessagePubSubErrorThreshold=Invalid error threshold for publishing. Ensure the value is a positive number.
1616
errorMessageIncorrectBQChunkSize=Value must be a multiple of 262144.
17-
errorMessageIncorrectBQBucketName=Bucket name can only contain lowercase letters, numbers, '.', '_', and '-'.
18-
errorMessageIncorrectBQTableName=Table name can only contain letters (lower or uppercase), numbers, '_' and '-'.
19-
errorMessageIncorrectBQProperty=PROPERTY name can only contain letters (lower or uppercase), numbers and '_'.
17+
errorMessageIncorrectBQBucketName=Bucket name 'VALUE' can only contain lowercase letters, numbers, '.', '_', and '-'.
18+
errorMessageIncorrectBQTableName=Table name 'VALUE' can only contain letters (lower or uppercase), numbers, '_' and '-'.
19+
errorMessageIncorrectBQProperty=PROPERTY name 'VALUE' can only contain letters (lower or uppercase), numbers and '_'.
20+
errorMessageIncorrectDatasetName=Dataset name 'VALUE' can only contain letters (lower or uppercase), numbers and '_'.
2021
errorMessageInvalidPath=Error when trying to detect schema: Input path not found
2122
errorMessageBQExecuteTableDataset=Dataset and table must be specified together.
2223
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.

src/e2e-test/resources/pluginParameters.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ bqChunkSize=262144
216216
bqInvalidChunkSize=26214
217217
bqInvalidSinkDataset=$#%$
218218
bqInvalidSinkTable=(*^*&*
219+
bqInvalidPropertyValue=$#%^&
219220
bqInvalidTemporaryBucket=$#%$
220221
bqInvalidRefName=invalidRef&^*&&*
221222
bqDatatypeChange1=[{"key":"Id","value":"long"},{"key":"Value","value":"long"}]

0 commit comments

Comments
 (0)