-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
[plugin-rest-api] Allow to work with archives from any source #2797
Conversation
vividus-plugin-rest-api/src/main/java/org/vividus/steps/api/HttpResponseValidationSteps.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2797 +/- ##
============================================
- Coverage 96.63% 88.91% -7.72%
- Complexity 5638 5853 +215
============================================
Files 797 798 +1
Lines 16076 16107 +31
Branches 1057 1058 +1
============================================
- Hits 15535 14322 -1213
- Misses 428 1652 +1224
- Partials 113 133 +20
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
vividus-plugin-rest-api/src/main/java/org/vividus/archive/steps/ArchiveSteps.java
Outdated
Show resolved
Hide resolved
vividus-plugin-rest-api/src/main/java/org/vividus/archive/steps/ArchiveSteps.java
Outdated
Show resolved
Hide resolved
vividus-plugin-rest-api/src/main/java/org/vividus/archive/steps/ArchiveSteps.java
Outdated
Show resolved
Hide resolved
vividus-plugin-rest-api/src/main/java/org/vividus/archive/steps/ArchiveSteps.java
Outdated
Show resolved
Hide resolved
vividus-plugin-rest-api/src/main/java/org/vividus/archive/steps/ArchiveSteps.java
Show resolved
Hide resolved
Optional.ofNullable(zipEntries.get(path)).ifPresentOrElse( | ||
data -> variableContext.putVariable(arcVar.getScopes(), arcVar.getVariableName(), | ||
arcVar.getOutputFormat().convert(data)), | ||
() -> softAssert.recordFailedAssertion( |
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.
hmm thinking about letting the end user know what entries we have inside the archive
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.
it could be an overkill if archive contains many entries
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.
@valfirst I didn't suggest to write print out archive entries for each assertion, this was the idea in general
{ | ||
List<String> expectedEntries = parameters.stream().map(ArchiveVariable::getPath).collect(Collectors.toList()); | ||
Map<String, byte[]> zipEntries = ZipUtils.readZipEntriesFromBytes(archiveData.getBytes(), | ||
expectedEntries::contains); |
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.
if there are no zipEntries does it make sense to skip the rest of the logic and record just smth like "archive is empty"? and in the step below
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.
nope, we need a failed assertion for each row in the table in this case
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.
what is the point to find entries in empty archive?
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.
we need a failed assertion for each row in the table in this case
Kudos, SonarCloud Quality Gate passed! |
Closes #2743