Provide a PactDslResponse matchHeader with noRegexp?
See original GitHub issueWould it be possible to provide a method matchHeaderExact(header, example) to PactDSLResponse that it is possible to add a header without a regexp?
My use-case: I like to test whether the expected media-type is returned from the server. I found a workaround to provide it like .matchHeader("Content-Type", ".", "application/vnd.ehmkah.app-1.0+json")
which makes it difficult to read. Or is that the way I should do it with pact?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Provide a PactDslResponse matchHeader with noRegexp?
My use-case: I like to test whether the expected media-type is returned from the server. I found a workaround to provide it like...
Read more >au.com.dius.pact.consumer.dsl.PactDslResponse ... - Tabnine
Match a response header. A random example header value will be generated from the provided regular expression. Popular methods of PactDslResponse. body.
Read more >PactDslRequestWithoutPath - Javadoc.io
Matches a datetime field using the provided pattern. The current system date and time will be used for the example value. Parameters: field...
Read more >PactDslResponse.java example - Javatips.net
This class describes the usage of PactDslResponse.java. ... @param regexp Regular expression to match */ public PactDslResponse matchHeader(String header, ...
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
It should be used to specify only the headers you want to match on (not all headers). You can set your single header value there.
With the additional information the issue is closed for me.