@@ -220,6 +220,33 @@ public void shouldNotValidateSchemaKeyFieldWhenMultipleSchemaSourcesAreSet() {
220
220
);
221
221
}
222
222
223
+ @ Test
224
+ public void shouldAllowSettingGenerateTimeoutInRange () {
225
+ clearSchemaSources ();
226
+ config .put (DatagenConnectorConfig .GENERATE_TIMEOUT_CONF , "100" );
227
+ config .put (DatagenConnectorConfig .SCHEMA_FILENAME_CONF , "product.avro" );
228
+ Config validated = connector .validate (config );
229
+ assertThat (validated , hasNoValidationErrorsFor (DatagenConnectorConfig .GENERATE_TIMEOUT_CONF ));
230
+ }
231
+
232
+ @ Test
233
+ public void shouldNotAllowSettingGenerateTimeoutNegative () {
234
+ clearSchemaSources ();
235
+ config .put (DatagenConnectorConfig .GENERATE_TIMEOUT_CONF , "-1" );
236
+ config .put (DatagenConnectorConfig .SCHEMA_FILENAME_CONF , "product.avro" );
237
+ Config validated = connector .validate (config );
238
+ assertThat (validated , hasValidationError (DatagenConnectorConfig .GENERATE_TIMEOUT_CONF , 1 ));
239
+ }
240
+
241
+ @ Test
242
+ public void shouldNotAllowSettingGenerateTimeoutOutOfRange () {
243
+ clearSchemaSources ();
244
+ config .put (DatagenConnectorConfig .GENERATE_TIMEOUT_CONF , "70000" );
245
+ config .put (DatagenConnectorConfig .SCHEMA_FILENAME_CONF , "product.avro" );
246
+ Config validated = connector .validate (config );
247
+ assertThat (validated , hasValidationError (DatagenConnectorConfig .GENERATE_TIMEOUT_CONF , 1 ));
248
+ }
249
+
223
250
protected void assertTaskConfigs (int maxTasks ) {
224
251
List <Map <String , String >> taskConfigs = connector .taskConfigs (maxTasks );
225
252
assertEquals (maxTasks , taskConfigs .size ());
0 commit comments