opendiffy/diffy

Home Page:XX failing of XX requests ERROR

Quan-HS opened this issue · 2 comments

1. The problem
image

as is shown,there's only one difference here,but result two.

file InMemoryDifferenceCollector.scala
class InMemoryEndpointMetadata
def add
if (diffs.nonEmpty) //Error of judgment logic

2. Here's my fix

def isNoDifference: Any => Boolean = { case _: NoDifference[_] => true case _ => false }

val diffsReal = diffs.filter(diff => !isNoDifference(diff._2)).toSeq
//if (diffs.nonEmpty) { if (diffsReal.nonEmpty) {

3. Here's some more feedback for debug

  1. "application.yml" need the mongo configure, otherwise “not bean”
  2. "traffic.sh" each request need add ' -H "Content-Type:application/json"',otherwise show "application/x-www-form-urlencoded",because default to be this.Actually setting 'Content-Type' might not work
  3. "traffic.sh" need query " http://localhost:8880/json?query=test", because 't.getRequestURI().getQuery()' be null, "lambda.apply" throw an anomaly , Handler need this for 'String.format'.
  4. find different not easy,need check every Fields,Not as clear as the 1.0 . perhaps it would be better to add a sort or tag.

Looking forward to the now version 👏🏻

Thanks for your detailed analysis and feedback on this bug. The main issues you raised has been fixed and released.

I am not sure I follow all the points you raised in "feedback for debug". 4 is clear that we need to think about how to better highlight differences. 1, 2, and 3 are a bit unclear to me. Please feel free to elaborate.

Refer to "QUICKSTART.md", In order for the program to run by shell, need to modify the relevant code
1.traffic.sh
No set the "Content-Type",Content-Type default value is "application/x-www-form-urlencoded"

  • curl -s -i -X POST -d 'Microsoft' -H "Canonical-Resource:text" -H "Content-Type:application/json"

2.ExampleServers.java
"Name" from http body
image

3. application.yml
It should be set to true by default, "docker-compose.yml"has been set the value
allowHttpSideEffects: true

@puneetkhanduri