Skip to content

Commit

Permalink
Merge pull request #327 from telekom/fix/npe-at-retry-analyzer-part2
Browse files Browse the repository at this point in the history
Fixed to prevent NPE at retry analyzer (part2)
  • Loading branch information
martingrossmann authored Jun 12, 2023
2 parents 56f7612 + c1d3eca commit cbe5388
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import eu.tsystems.mms.tic.testframework.report.model.context.AbstractContext;
import eu.tsystems.mms.tic.testframework.report.model.context.MethodContext;
import eu.tsystems.mms.tic.testframework.report.utils.ExecutionContextController;
import org.apache.commons.lang3.StringUtils;
import org.testng.IRetryAnalyzer;
import org.testng.ITestNGMethod;
import org.testng.ITestResult;
Expand Down Expand Up @@ -73,7 +74,11 @@ public enum Properties implements IProperties {

@Override
public Object getDefault() {
return null;
return defaultValue;
}

public String toString() {
return property;
}
}

Expand All @@ -89,7 +94,7 @@ public Object getDefault() {

static {
final String classes = Properties.FAILED_TESTS_IF_THROWABLE_CLASSES.asString();
if (classes != null) {
if (StringUtils.isNotBlank(classes)) {
String[] split = classes.split(",");
for (String clazz : split) {
try {
Expand All @@ -102,7 +107,7 @@ public Object getDefault() {
}

final String messages = Properties.FAILED_TESTS_IF_THROWABLE_MESSAGES.asString();
if (messages != null) {
if (StringUtils.isNotBlank(messages)) {
String[] split = messages.split(",");
for (String message : split) {
MESSAGES_LIST.add(message.trim());
Expand Down

0 comments on commit cbe5388

Please sign in to comment.