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.

Matchers.scala ignores timestamp format specification and only uses the TypeMatcher

See original GitHub issue

In pact-jvm-matchers 2.x, a PACT like

          "$.body[0].write-timestamp": {
            "match": "timestamp",
            "timestamp": "yyyy-MM-dd\u0027T\u0027HH:mm:ss.SSS\u0027Z\u0027"
          }

erroneously rejects a value like 2017-08-11T02:54:42.522Z with the error Expected '2017-08-11T02:54:42.522Z' to be a timestamp.

This is likely to be caused by Matchers.scala using the typeMatcher instead of the timestampMatcher to match timestamps. That causes to ignore the format specification, and only accept strict ISO formats.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
uglyogcommented, Aug 14, 2017

Yes, I can do that.

0reactions
dberrueta-atlassiancommented, Aug 17, 2017

I confirm that 2.4.19 fixes the bug.

Thank you for the quick response and release, I appreciate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Matchers.scala ignores timestamp format specification and ...
This is likely to be caused by Matchers.scala using the typeMatcher instead of the timestampMatcher to match timestamps. That causes to ignore ......
Read more >
Using matchers - ScalaTest
Using matchers. ScalaTest provides a domain specific language (DSL) for expressing assertions in tests using the word should . Just mix in should....
Read more >
Matching | Pact Docs
If the example value is omitted, a value will be generated using a Timestamp generator and the current system date and time. time,...
Read more >
Spark (Scala) Parsing issue of a fields having timestamp ...
I think you only have to consider first 3 digits of milliseconds. ... use from_unixtime(unix_time(column, 'timestamp format'), 'format').
Read more >
Expression functions in the mapping data flow - Microsoft Learn
Use the function syntax(true()) if there's a column named 'true'. typeMatch, Matches the type of the column. Can only be used in pattern ......
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