question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a PactDslResponse matchHeader with noRegexp?

See original GitHub issue

Would 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
uglyogcommented, Aug 13, 2017

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.

0reactions
ehmkahcommented, Aug 16, 2017

With the additional information the issue is closed for me.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found