-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datajck4 #89
Conversation
clicman
commented
Sep 8, 2018
- Update to datajack-4.0.2
- Do not fetch all providers by default. Add dependency to the final project only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try { | ||
return (List<Tag>) FieldUtils.readField(scenarioDefinition, "tags", true); | ||
} catch (IllegalArgumentException | IllegalAccessException e) { | ||
return new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R we gonna mutate this one? If no I suggest to use Collections.EMPTY_LIST to avoid memory allocation
page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/data/DataParser.java
Show resolved
Hide resolved
String parsedValue = DataFactory.getInstance().get(dataPath).getValue(); | ||
replacedStep = replacedStep.replace(stepDataMatcher.start(3) - 1 + offset, stepDataMatcher.end(3) + offset, parsedValue); | ||
offset += parsedValue.length() - 1 - value.length(); | ||
String builtPath = collection == null ? "$" + value : "$" + collection + value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$" + (collection == null ? "" : collection) + value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataFolder, | ||
initialCollection | ||
); | ||
break; | ||
case "mongo": | ||
testDataProvider = initProvider(PROVIDERS.MONGO_DATA_PROVIDER, | ||
new MongoClient(new MongoClientURI(Props.get("data.uri"))).getDB("data.db"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Smell: Remove this use of "getDB"; it is deprecated. (squid:CallToDeprecatedMethod)
try { | ||
return (List<Tag>) FieldUtils.readField(scenarioDefinition, "tags", true); | ||
} catch (IllegalArgumentException | IllegalAccessException e) { | ||
return Collections.EMPTY_LIST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Smell: Replace "Collections.EMPTY_LIST" by "Collections.emptyList()". (squid:S1596)
dataFolder, | ||
initialCollection | ||
); | ||
break; | ||
case "mongo": | ||
testDataProvider = initProvider(PROVIDERS.MONGO_DATA_PROVIDER, | ||
new MongoClient(new MongoClientURI(Props.get("data.uri"))).getDB("data.db"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Use try-with-resources or close this "MongoClient" in a "finally" clause. (squid:S2095)