E528 Improved Test Structure and Tests in DefectDojo Hook by JohannesZahn · Pull Request #600 · secureCodeBox/secureCodeBox · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@JohannesZahn
Copy link
Contributor
@JohannesZahn JohannesZahn commented Aug 18, 2021

Description

The Mapper converting SecureCodeBox to DefectDojo Findings accepted and returned JSON Strings and could therefore not easily be tested. Now the Mapper only Converts secureCodeBox Findings Objects to defectDojo Findings Objects. There were previously some tests for this mapping but they were enhanced by seperating tests for mapping dates, descriptions and basic fields.

A Test Class for the ScanResultService (which returns the ScanResults that are passed to DefectDojo) was introduced that is now resposible for testing that the assembled scan results that will be uploaded to defectDojo are processed correctly.

Furthermore the PersistenceConfig now features a field to specify a Timezone for parsing dates instead of using the default timezone on a machine. Therefore the timezone can be set in the unit tests to ensure they produce the same results regardles of the location

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 JohannesZahn added hook Implement or update a hook defectdojo All issues regarding the DefectDojo Integration labels Aug 18, 2021
@JohannesZahn JohannesZahn self-assigned this Aug 18, 2021
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
@JohannesZahn JohannesZahn marked this pull request as ready for review August 19, 2021 08:09
@JohannesZahn JohannesZahn requested a review from J12934 August 19, 2021 08:12
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
@JohannesZahn
Copy link
Contributor Author

@J12934 this is ready for review, however one check does not complete, I tried re-running all jobs but it didn't seem to help.

J12934
J12934 previously approved these changes Aug 20, 2021
Copy link
Member
@J12934 J12934 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Added some minor suggestions to log lines which might be a bit confusing without punctuation.

JohannesZahn and others added 2 commits August 20, 2021 12:35
…ox/persistence/service/scanresult/GenericParserScanResultService.java

Co-authored-by: Jannik Hollenbach <jannik.hollenbach@iteratec.com>
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
…ox/persistence/service/scanresult/SpecificParserScanResultService.java

Co-authored-by: Jannik Hollenbach <jannik.hollenbach@iteratec.com>
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
@JohannesZahn JohannesZahn force-pushed the maintenance/enhance-dd-hook-tests branch from c8ad75f to 6921b35 Compare August 20, 2021 10:35
@JohannesZahn
Copy link
Contributor Author

I commited your suggestions @J12934 :)

@JohannesZahn JohannesZahn requested a review from J12934 August 20, 2021 10:49
@J12934 J12934 merged commit 9000a41 into main Aug 20, 2021
@J12934 J12934 deleted the maintenance/enhance-dd-hook-tests branch August 20, 2021 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

defectdojo All issues regarding the DefectDojo Integration hook Implement or update a hook

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0