Programmable HTTP mock server#529
Conversation
Codecov Report
@@ Coverage Diff @@
## master #529 +/- ##
==========================================
+ Coverage 83.69% 83.72% +0.02%
==========================================
Files 216 216
Lines 7992 8000 +8
Branches 583 578 -5
==========================================
+ Hits 6689 6698 +9
+ Misses 1303 1302 -1
Continue to review full report at Codecov.
|
ec95080 to
31f2492
Compare
| } | ||
| prefix.hashCode * 13 + headerHash | ||
| prefix.hashCode * 13 + headerHash | ||
| } |
There was a problem hiding this comment.
Computing hash value hasn't worked if HeaderMap is empty.
| override def requestHash(request: Request): Int = { | ||
| val content = request.getContentString() | ||
| s"${request.method.toString()}:${recorderConfig.destAddress.hostAndPort}${request.uri}:${content.hashCode}".hashCode | ||
| } |
There was a problem hiding this comment.
It's difficult to program exact same headers. I think matching by method, address, uri and content is good enough in the programmable HTTP mock server.
There was a problem hiding this comment.
ok. Let's add a customization entry point to HttpRecordStore later to add user-defined pattern matching rules.
No change is required for now.
There was a problem hiding this comment.
My idea is adding a method like:
HttpRecordStore.withRequestMatcher(matcher:PartialFunction[Request, Response])
31f2492 to
55508ed
Compare
55508ed to
02542fb
Compare
No description provided.