Response null instead of mocked resource
See original GitHub issueSimilar to pact-js
I expected the response to be mocked so I could test an API client against pact’s mock server. I modified example code to match my implementation as well. My codebase uses OpenAPI to generate the api client.
However I could not assert any of my tests due to the response being always null
.
Reproduction steps with an OpenAPI generated petstore: https://github.com/tomsiwik/oas-pactnet-error
Now I’m not sure if this is csharp-netcore
’s client generator or that I’m using PactNet version 4.0.0-beta.3
.
Is this a bug or am I doing something wrong here? Thanks in advance.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Mockito mock objects returns null - java
All method calls to Mockito mocks return null by default. If you want it to return something else you need to tell it...
Read more >Mockito 1.10.19 mock returns null instead of result #1374
Mocking rest template to return a response entity fails, instead of receiving a response entity, the value returned by the mock is null....
Read more >Don't understand why my Mocked method always returns null
Given this Class Under Test: --- package macau.gr8 class Grader2 { def expectedAnswers def graderFileReader def grade(String s) {
Read more >Returns won't return null in JustMock
I will get an instance of IList<IBob> back instead of null. ... Also, you can't return null directly like one you mentioned: Mock....
Read more >Stubbing and Mocking with Mockito and JUnit
Learn how to create true unit tests by mocking all external dependencies in your JUnit classes with the help of Mockito.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added:
LogLevel = PactLogLevel.Debug
toPactConfig
. I can’t specify a log-file though.The assertion (inside async Task):
Hope this helps.
Hi @tomsiwik, I noticed you closed the issue. Did you get to the bottom of it?