Skip to content
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

MG-2147 - Generate mocks with mockery for Consumer service #2150

Merged
merged 18 commits into from
Apr 22, 2024

Conversation

nyagamunene
Copy link
Contributor

What type of PR is this?

This is a feature because its add the following functionality: generates mocks for consumers.

What does this do?

It generates the mocks for consumers service.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, I have included tests

Did you document any new/modified feature?

No, I have not updated the documentation.

Notes

@nyagamunene nyagamunene changed the title MG-2143 - Generate mocks with mockery for Consumer service MG-2147 - Generate mocks with mockery for Consumer service Apr 9, 2024
@nyagamunene nyagamunene self-assigned this Apr 9, 2024
@nyagamunene nyagamunene added this to the S2 milestone Apr 11, 2024
@nyagamunene nyagamunene force-pushed the MG-GenerateMocksForConsumers branch from b7b378b to 46b893c Compare April 11, 2024 10:45
@nyagamunene nyagamunene marked this pull request as ready for review April 11, 2024 10:54
}
}

func GetSubscriptionsSlice(subs []sdk.Subscription, start, end int) []notifiers.Subscription {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Simplify and rename (and don't export):

func subscriptionsSlice(subs []sdk.Subscription, start, end int) []notifiers.Subscription {
	var res []notifiers.Subscription
	for i := start; i < end; i++ {
		sub := subs[i]
		res = append(res, notifiers.Subscription{
			ID:      sub.ID,
			OwnerID: sub.OwnerID,
			Contact: sub.Contact,
			Topic:   sub.Topic,
		})
	}
	return res
}

consumers/notifiers/service_test.go Outdated Show resolved Hide resolved
consumers/notifiers/service_test.go Outdated Show resolved Hide resolved
@nyagamunene nyagamunene force-pushed the MG-GenerateMocksForConsumers branch from ed11150 to 33344a7 Compare April 12, 2024 07:31
@JeffMboya JeffMboya mentioned this pull request Apr 14, 2024
14 tasks
@nyagamunene nyagamunene force-pushed the MG-GenerateMocksForConsumers branch 3 times, most recently from 65dfb7f to 6cbb677 Compare April 16, 2024 09:04
consumers/notifiers/api/endpoint_test.go Outdated Show resolved Hide resolved
consumers/notifiers/api/endpoint_test.go Outdated Show resolved Hide resolved
consumers/notifiers/service_test.go Outdated Show resolved Hide resolved
consumers/notifiers/service_test.go Outdated Show resolved Hide resolved
@nyagamunene nyagamunene force-pushed the MG-GenerateMocksForConsumers branch 4 times, most recently from 3b487c1 to aa0a128 Compare April 16, 2024 14:18
pkg/sdk/go/consumers_test.go Outdated Show resolved Hide resolved
@nyagamunene nyagamunene force-pushed the MG-GenerateMocksForConsumers branch 3 times, most recently from 3ce8750 to 0e05fbe Compare April 18, 2024 07:57
consumers/notifiers/service_test.go Outdated Show resolved Hide resolved
pkg/sdk/go/consumers_test.go Outdated Show resolved Hide resolved
@nyagamunene nyagamunene force-pushed the MG-GenerateMocksForConsumers branch from 5b10e35 to 161e57a Compare April 18, 2024 15:25
@nyagamunene nyagamunene force-pushed the MG-GenerateMocksForConsumers branch from 161e57a to b8a2968 Compare April 19, 2024 13:09
rodneyosodo
rodneyosodo previously approved these changes Apr 19, 2024
@@ -181,6 +193,8 @@ func TestListSubscriptions(t *testing.T) {
Subscriptions: subs[:3],
Total: total,
},
identifyErr: nil,
identityRes: &magistrala.IdentityRes{Id: validID},
Copy link
Collaborator

Choose a reason for hiding this comment

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

User string instead of the full response; return response in the assert. Do the same for all the other test cases.

@dborovcanin dborovcanin merged commit cf832af into absmach:main Apr 22, 2024
6 checks passed
JeffMboya pushed a commit to JeffMboya/supermq that referenced this pull request May 15, 2024
JeffMboya pushed a commit to JeffMboya/supermq that referenced this pull request May 15, 2024
andychao217 pushed a commit to andychao217/magistrala that referenced this pull request Sep 23, 2024
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.

Feature: Generate mocks with mockery for Consumers service
3 participants