Skip to content

Commit

Permalink
updated logging of resolved variable value
Browse files Browse the repository at this point in the history
  • Loading branch information
GannaChernyshova committed Nov 23, 2018
1 parent 3072e3c commit 0aab0fa
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static java.lang.String.format;
import static ru.alfabank.tests.core.helpers.PropertyLoader.loadProperty;

/**
Expand Down Expand Up @@ -95,6 +96,8 @@ public static String resolveVars(String inputString) {
}
if (newString.isEmpty()) {
newString = inputString;
} else {
AkitaScenario.getInstance().write(format("Значение переменной %s = %s", inputString, newString));
}
return newString;
}
Expand All @@ -117,8 +120,8 @@ public static String resolveJsonVars(String inputJsonAsString) {
String value = loadProperty(varName, (String) AkitaScenario.getInstance().tryGetVar(varName));
if (value == null) {
AkitaScenario.getInstance().write(
"Значение " + varName +
" не было найдено ни в application.properties, ни в environment переменной");
"Значение " + varName +
" не было найдено ни в application.properties, ни в environment переменной");
}
newString = m.replaceFirst(value);
if (isJSONValid(newString)) return newString;
Expand Down

0 comments on commit 0aab0fa

Please sign in to comment.