test(json-mapper): adding domain level example with formula (#16509)#16510
test(json-mapper): adding domain level example with formula (#16509)#16510aHenryJard wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #16510 +/- ##
==========================================
+ Coverage 22.97% 23.44% +0.47%
==========================================
Files 3233 3323 +90
Lines 171674 176995 +5321
Branches 42549 44701 +2152
==========================================
+ Hits 39447 41503 +2056
- Misses 132227 135492 +3265
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds domain-level integration test coverage for JSON Mapper “complex path” formulas in the opencti-graphql ingestion module test suite, aiming to validate formula usage (string concatenation, decision matrix logic, and regexp extraction) when parsing JSON bundles.
Changes:
- Added integration tests that create a JSON mapper configuration using
complex_path.formula. - Added a
jsonMapperTestscenario parsing a STIX bundle with formula-based attribute mapping. - Added a
jsonMapperTestscenario coveringextractWithRegexp(...)formula behavior.
| const result = await jsonMapperTest(testContext, ADMIN_USER, configuration, fileUpload); | ||
|
|
||
| expect(result).toBeDefined(); | ||
| expect(result.nbEntities).toBeGreaterThan(0); |
There was a problem hiding this comment.
As you already check that nbEntities is equal to 4, I think you could remove this line
| ], | ||
| }); | ||
|
|
||
| const representations = [ |
There was a problem hiding this comment.
You could declare it once in a global describe and then use it for the tests as it is exactly the same (except the first is stringified). Or return it from a function to be sure it is a new object in between tests
There was a problem hiding this comment.
yes I hesitate to move that to a "data' file like we did in some other tests, but in the other hand it can be hidden easily in IDE, will look. Thanks for feedbacks !
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Proposed changes
Related issues
How to test this PR
Checklist
Further comments