-
Notifications
You must be signed in to change notification settings - Fork 478
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
feat(metadata)!: replace REST device validation callback with MessageBus #4366
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #4366 +/- ##
=======================================
Coverage 43.71% 43.71%
=======================================
Files 116 116
Lines 10713 10712 -1
=======================================
Hits 4683 4683
+ Misses 5610 5609 -1
Partials 420 420
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
} | ||
for _, testCase := range tests { | ||
t.Run(testCase.name, func(t *testing.T) { | ||
jsonData, err := json.Marshal(testCase.request) | ||
require.NoError(t, err) | ||
|
||
var responseEnvelope types.MessageEnvelope | ||
mockMessaging := &messagingMocks.MessageClient{} | ||
mockMessaging.On("Publish", mock.Anything, mock.Anything).Return(nil) |
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.
Why is mock on Publish needed here? Request encapsulates it, should mocking Request will keep it from actually being called.
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.
This is called in valid case for publishing system event.
I added ffb0bc6 to better test this behavior
BREAKING CHANGE: adding new device requires device service running closes #4236 Signed-off-by: Chris Hung <chris@iotechsys.com>
to actually test the message bus behavior Signed-off-by: Chris Hung <chris@iotechsys.com>
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM
BREAKING CHANGE: adding new device requires device service running
closes #4236
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md
PR Checklist
Please check if your PR fulfills the following requirements:
BREAKING CHANGE:
describing the break)Testing Instructions
See edgexfoundry/device-sdk-go#1325
New Dependency Instructions (If applicable)