@@ -57,15 +57,20 @@ public Report(String reportPath, String reportName, HashMap<String, String> klov
57
57
reports .setSystemInfo ("Executor" , System .getProperty ("user.name" ));
58
58
reports .setSystemInfo ("SoapUI Version" , SoapUI .SOAPUI_VERSION );
59
59
60
- if (!klovConfig .get ("MongoDBIP" ).isEmpty () && !klovConfig .get ("MongoDBPort" ).isEmpty ()
61
- && !klovConfig .get ("KlovServerUrl" ).isEmpty ()) {
62
- ExtentKlovReporter klov = new ExtentKlovReporter (reportName );
63
- klov .initMongoDbConnection (klovConfig .get ("MongoDBIP" ),
64
- Integer .parseInt (klovConfig .get ("MongoDBPort" )));
65
- klov .setProjectName (reportName );
66
- klov .setReportName ("2.0" );
67
- klov .initKlovServerConnection (klovConfig .get ("KlovServerUrl" ));
68
- reports .attachReporter (spark , klov );
60
+ if (klovConfig .size () != 0 ) {
61
+ if (!klovConfig .get ("MongoDBIP" ).isEmpty () && !klovConfig .get ("MongoDBPort" ).isEmpty ()
62
+ && !klovConfig .get ("KlovServerUrl" ).isEmpty ()) {
63
+ ExtentKlovReporter klov = new ExtentKlovReporter (reportName );
64
+ klov .initMongoDbConnection (klovConfig .get ("MongoDBIP" ),
65
+ Integer .parseInt (klovConfig .get ("MongoDBPort" )));
66
+ klov .setProjectName (reportName );
67
+ klov .setReportName ("2.0" );
68
+ klov .initKlovServerConnection (klovConfig .get ("KlovServerUrl" ));
69
+ reports .attachReporter (spark , klov );
70
+ } else {
71
+ SoapUI .log ("Klov Configuration missing or Wrong" );
72
+ reports .attachReporter (spark );
73
+ }
69
74
} else {
70
75
reports .attachReporter (spark );
71
76
}
@@ -411,19 +416,15 @@ public void addEnvironmentDetails(List<TestProperty> properties) {
411
416
flag = envLogCheck (properties );
412
417
if (flag ) {
413
418
int propSize = properties .size ();
414
- if (propSize != 0 ) {
415
- for (int propInterator = 0 ; propInterator < propSize ; propInterator ++) {
416
- if (properties .get (propInterator ).getName ().contains ("Password" )
417
- || properties .get (propInterator ).getName ().contains ("Pass" )) {
418
- reports .setSystemInfo (properties .get (propInterator ).getName (), "*******" );
419
- } else {
420
- reports .setSystemInfo (properties .get (propInterator ).getName (),
421
- properties .get (propInterator ).getValue ());
422
- }
419
+ for (int propInterator = 0 ; propInterator < propSize ; propInterator ++) {
420
+ if (properties .get (propInterator ).getName ().contains ("Password" )
421
+ || properties .get (propInterator ).getName ().contains ("Pass" )) {
422
+ reports .setSystemInfo (properties .get (propInterator ).getName (), "*******" );
423
+ } else {
424
+ reports .setSystemInfo (properties .get (propInterator ).getName (),
425
+ properties .get (propInterator ).getValue ());
423
426
}
424
427
}
425
- } else {
426
- reports .setSystemInfo ("AddDataToReport" , "False" );
427
428
}
428
429
} catch (Exception e ) {
429
430
String exceptionMessage = " Exception occurred for Report method - addEnvironmentDetails as " ;
@@ -432,31 +433,29 @@ public void addEnvironmentDetails(List<TestProperty> properties) {
432
433
}
433
434
434
435
private boolean envLogCheck (List <TestProperty > properties ) {
435
- boolean propValue = true ;
436
+ boolean logValues = true ;
436
437
try {
437
438
int propSize = properties .size ();
438
- if (propSize != 0 ) {
439
- for (int propInterator = 0 ; propInterator < propSize ; propInterator ++) {
440
- if (properties .get (propInterator ).getName ().equalsIgnoreCase ("AddDataToReport" )) {
441
- if (properties .get (propInterator ).getValue ().equalsIgnoreCase ("True" )) {
442
- return propValue ;
443
- } else if (properties .get (propInterator ).getValue ().equalsIgnoreCase ("False" )) {
444
- return false ;
445
- } else {
446
- SoapUI .log (
447
- "Invalid value specified for 'AddDataToReport' in project properties. Please check and correct." );
448
- return propValue ;
449
- }
439
+ for (int propInterator = 0 ; propInterator < propSize ; propInterator ++) {
440
+ if (properties .get (propInterator ).getName ().equalsIgnoreCase ("AddDataToReport" )) {
441
+ if (properties .get (propInterator ).getValue ().equalsIgnoreCase ("True" )) {
442
+ return logValues ;
443
+ } else if (properties .get (propInterator ).getValue ().equalsIgnoreCase ("False" )) {
444
+ return false ;
450
445
} else {
451
- propValue = true ;
446
+ SoapUI .log (
447
+ "Invalid value specified for 'AddDataToReport' in project properties. Please check and correct." );
448
+ return logValues ;
452
449
}
450
+ } else {
451
+ logValues = true ;
453
452
}
454
453
}
455
454
} catch (Exception e ) {
456
455
String exceptionMessage = " Exception occurred for Report method - addEnvironmentDetails as " ;
457
456
SoapUI .log (exceptionMessage + e .toString ());
458
457
}
459
- return propValue ;
458
+ return logValues ;
460
459
}
461
460
462
461
private String getEndpoint (String endPoint ) {
0 commit comments