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

[Service Bus Functions Extensions] Actions Mock Support #25489

Merged
1 commit merged into from
Nov 23, 2021

Conversation

jsquire
Copy link
Member

@jsquire jsquire commented Nov 23, 2021

Summary

The focus of these changes is to add a protected constructor to the ServiceBusMessageActions class to support mocking for test scenarios.

References and Related

The focus of these changes is to add a protected constructor to the
`ServiceBusMessageActions` class to support mocking for test scenarios.
@jsquire jsquire added Service Bus Client This issue points to a problem in the data-plane of the library. Functions labels Nov 23, 2021
@jsquire jsquire added this to the [2021] December milestone Nov 23, 2021
@jsquire jsquire self-assigned this Nov 23, 2021
@azure-sdk
Copy link
Collaborator

API changes have been detected in Microsoft.Azure.WebJobs.Extensions.ServiceBus. You can review API changes here

API changes

+         protected ServiceBusMessageActions();

@ghost
Copy link

ghost commented Nov 23, 2021

Hello @jsquire!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 8b87c33 into Azure:main Nov 23, 2021
@jsquire jsquire deleted the sbtrigger/mocking-actions branch November 23, 2021 16:44
/// This constructor exists only to support mocking. When used, class state is not fully initialized, and
/// will not function correctly; virtual members are meant to be mocked.
///</remarks>
protected ServiceBusMessageActions()
Copy link
Member

Choose a reason for hiding this comment

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

I think we will need to add this for the derived class too - ServiceBusSesssionMessageActions.

Copy link
Member Author

Choose a reason for hiding this comment

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

My bad; didn't see it when I patched this. I'll push that out in another PR.

@JoshLove-msft
Copy link
Member

Fixes #25405

ghost pushed a commit that referenced this pull request Nov 23, 2021
# Summary

The focus of these changes is to add a protected constructor to the `ServiceBusSessionMessageActions` class to support mocking for test scenarios.

# References and Related

- [Twitter thread discussing mocking difficulties](https://twitter.com/rolandkru/status/1462756372651593733)
- [[Service Bus Functions Extensions] Actions Mock Support (#25489)](#25489)
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Functions Service Bus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants