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

Mocking an HTTP Request to an External API not mocking #41

Open
ShaneLucykHCS opened this issue Nov 19, 2024 · 2 comments
Open

Mocking an HTTP Request to an External API not mocking #41

ShaneLucykHCS opened this issue Nov 19, 2024 · 2 comments

Comments

@ShaneLucykHCS
Copy link

We have run into an issue where we are unable to mock an HTTP request to an external API. No matter how we build the Mock, we receive live data back from the system.

In larger tests we have been able to mock request to local function app actions, but are unable to mock requests to an external API using the HTTP action.

I have attached the workflow.json, test class & project file, the parameters.json and the testConfiguration.json file.

HttpTriggerTests2.cs.txt
parameters.json
testConfiguration.json
Tests.csproj.txt
workflow.json

@mark-abrams
Copy link
Collaborator

Hi @ShaneLucykHCS , sorry about the delay in looking at this.

I've looked at the code that you uploaded. Are you saying that you can't get the framework to use this mock:

image

Or are you having trouble matching when you uncomment the four lines that match using the Path, Query parameters and HTTP headers?

@ShaneLucykHCS
Copy link
Author

Hi @ShaneLucykHCS , sorry about the delay in looking at this.

I've looked at the code that you uploaded. Are you saying that you can't get the framework to use this mock:

image

Or are you having trouble matching when you uncomment the four lines that match using the Path, Query parameters and HTTP headers?

I can't get the framework to use that mock. Or any mock against a node that makes a request against a REST API. It always makes the live request. Those commented-out lines are various attempts at matching on something other than the path in case it was a matching issue.

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

No branches or pull requests

2 participants