-
Notifications
You must be signed in to change notification settings - Fork 32
test: Refactor IntegrationResourceTest v2 #789
test: Refactor IntegrationResourceTest v2 #789
Conversation
mkralik3
commented
Jul 18, 2023
•
edited
Loading
edited
- Refactored IntegrationResourceTest (v2 only) to use Assertj for better error messages
- Resources which are used only in V1 test ( which is deprecated) were moved into separate folder ( can be deleted in the future with old resources tests ) and removed unused resources
- Some existing tests were extended and added kamelet metadata test
Codecov Report
@@ Coverage Diff @@
## main #789 +/- ##
=========================================
Coverage 79.24% 79.24%
Complexity 160 160
=========================================
Files 56 56
Lines 3040 3040
Branches 529 529
=========================================
Hits 2409 2409
Misses 415 415
Partials 216 216 |
041bb73
to
899e2eb
Compare
@@ -418,14 +464,14 @@ void roundTrip(String file) throws IOException { | |||
var sourceCode = res2.extract().body().asString(); | |||
|
|||
//This should be the same as the original source code |
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.
Sometimes, tests on my local machine failed here because the original yaml and generated yaml have different properties order spec.source.properties
properties:
apiKey: your own
keywords: Apache Camel
apiKeySecret: your own
accessToken: your own
accessTokenSecret: your own
properties:
keywords: Apache Camel
apiKey: your own
apiKeySecret: your own
accessToken: your own
accessTokenSecret: your own
Comparing YAMLs as objects should resolve that problem and will be resistant to the different ordering of elements.
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.
Do we have a good comparison tool for yaml objects? I couldn't find any, that's why I compare as strings. But compare as strings is a nightmare every time some minor change occurs (like change " by ')
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.
I don't know about any but I can try to find out some.
899e2eb
to
56decd4
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |