FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

DefectDojo Hook Tests now pass on any OS by JohannesZahn · Pull Request #596 · secureCodeBox/secureCodeBox · GitHub

DefectDojo Hook Tests now pass on any OS - #596

Closed
JohannesZahn wants to merge 2 commits into
mainfrom
bugfix/test-depending-on-linefeed
Closed

DefectDojo Hook Tests now pass on any OS#596
JohannesZahn wants to merge 2 commits into
mainfrom
bugfix/test-depending-on-linefeed

Conversation

Copy link
Copy Markdown
Contributor

Description

Unit Tests on Windows failed even though they were supposed to pass. This was due asserting JSON Objects as equal that contained different line breaks. This was fixed by using the Library JSONAssert.

Checklist

  • Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
  • Make sure npm test runs for the whole project.
  • Make codeclimate checks happy

Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
JohannesZahn changed the title DefectDojo Hook Tests now works with any OS DefectDojo Hook Tests now succeed with any OS Aug 12, 2021
JohannesZahn changed the title DefectDojo Hook Tests now succeed with any OS DefectDojo Hook Tests now pass on any OS Aug 12, 2021
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>

J12934 commented Aug 12, 2021

Copy link
Copy Markdown
Member

Could we remove the Json assert Lib by parsing the Json into our Finding Class and running the assertions on these?

Copy link
Copy Markdown
Contributor Author

It should be possible unless Jackson changes the order of the list which I am not completly sure on right now. I am also not sure if we should then use Jacksons ObjectNode.equals() on the JSON Findings or rely on a custom/lombok generated Equals methods on the Objects themselves. The second approach would look somewhat like this

DefectDojoImportFinding[] expectedDDFindings = jsonMapper.readValue(ddFindingsUrl, DefectDojoImportFinding[].class);
DefectDojoImportFinding[] actualDdFindings = jsonMapper.readValue(actualDdFindingsString, DefectDojoImportFinding[].class);
assertArrayEquals(expectedDDFindings,actualDdFindings);

Copy link
Copy Markdown
Contributor Author

This moved to #600

Weltraumschaf deleted the bugfix/test-depending-on-linefeed branch February 21, 2023 19:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL