3838import java .security .cert .X509Certificate ;
3939import java .util .*;
4040
41+ import static org .junit .jupiter .api .Assertions .fail ;
42+
4143public abstract class ConnectedRESTQA {
4244
4345 private static Properties testProperties = null ;
@@ -348,10 +350,15 @@ public static void setDatabaseProperties(String dbName, String prop, boolean pro
348350 * root property name else if it has an existing sub property name then it
349351 * adds elements to that array
350352 */
351- private static void setDatabaseProperties (String dbName , String propName , ObjectNode objNode ) throws IOException {
353+ private static void setDatabaseProperties (String dbName , String propName , ObjectNode objNode ) {
352354 ManageClient client = newManageClient ();
353355 String databaseProperties = new DatabaseManager (client ).getPropertiesAsJson (dbName );
354- JsonNode jnode = new ObjectMapper ().readTree (databaseProperties );
356+ JsonNode jnode = null ;
357+ try {
358+ jnode = new ObjectMapper ().readTree (databaseProperties );
359+ } catch (JsonProcessingException e ) {
360+ fail ("Could not parse database-properties: " + databaseProperties + "; cause: " + e .getMessage ());
361+ }
355362
356363 if (!jnode .has (propName )) {
357364 ((ObjectNode ) jnode ).putArray (propName ).addAll (objNode .withArray (propName ));
@@ -374,7 +381,7 @@ public static void enableCollectionLexicon(String dbName) {
374381 setDatabaseProperties (dbName , "collection-lexicon" , true );
375382 }
376383
377- public static void enableWordLexicon (String dbName ) throws Exception {
384+ public static void enableWordLexicon (String dbName ) {
378385 ObjectMapper mapper = new ObjectMapper ();
379386 ObjectNode childNode = mapper .createObjectNode ();
380387 ArrayNode childArray = mapper .createArrayNode ();
@@ -395,13 +402,11 @@ public static void setMaintainLastModified(String dbName, boolean opt) {
395402 * This function constructs a range element index with default
396403 * collation,range-value-positions and invalid values
397404 */
398- public static void addRangeElementIndex (String dbName , String type , String namespace , String localname )
399- throws Exception {
405+ public static void addRangeElementIndex (String dbName , String type , String namespace , String localname ) {
400406 addRangeElementIndex (dbName , type , namespace , localname , false );
401407 }
402408
403- public static void addRangeElementIndex (String dbName , String type , String namespace , String localname ,
404- boolean positions ) throws Exception {
409+ public static void addRangeElementIndex (String dbName , String type , String namespace , String localname , boolean positions ) {
405410 ObjectMapper mapper = new ObjectMapper ();
406411 ObjectNode mainNode = mapper .createObjectNode ();
407412
@@ -419,7 +424,7 @@ public static void addRangeElementIndex(String dbName, String type, String names
419424 setDatabaseProperties (dbName , "range-element-index" , mainNode );
420425 }
421426
422- public static void addRangeElementIndex (String dbName , String [][] rangeElements ) throws Exception {
427+ public static void addRangeElementIndex (String dbName , String [][] rangeElements ) {
423428 ObjectMapper mapper = new ObjectMapper ();
424429 ObjectNode mainNode = mapper .createObjectNode ();
425430
@@ -530,7 +535,7 @@ public static void addRangePathIndex(String dbName, String type, String pathexpr
530535 setDatabaseProperties (dbName , "range-path-index" , childNode );
531536 }
532537
533- public static void addRangePathIndex (String dbName , String [][] rangePaths ) throws Exception {
538+ public static void addRangePathIndex (String dbName , String [][] rangePaths ) {
534539 ObjectMapper mapper = new ObjectMapper ();
535540 ObjectNode childNode = mapper .createObjectNode ();
536541 ArrayNode childArray = mapper .createArrayNode ();
@@ -585,7 +590,7 @@ public static void addPathNamespace(String dbName, String[][] pathNamespace) thr
585590 setDatabaseProperties (dbName , "path-namespace" , childNode );
586591 }
587592
588- public static void setupAppServicesConstraint (String dbName ) throws Exception {
593+ public static void setupAppServicesConstraint (String dbName ) {
589594 // Add new range elements into this array
590595 String [][] rangeElements = {
591596 // { scalar-type, namespace-uri, localname, collation,
0 commit comments