oltu-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simonetrip...@apache.org>
Subject JSON comparison in test case best practice
Date Fri, 05 Dec 2014 18:39:34 GMT
Hi all mates,

there are a couple of tests in the oauth-2.0/common codebase failing on
CLI, but succeed in Eclipse, see below for details...

I honestly think that comparing serialised JSON strings is not thebest way
to assert two JSON documents are representing exactly the same data, we
need to handle that situation...

Does anybody know a best practice to compare json object, such as XMLDiff
of something else?
I am asking google, in the meanwhile... :)
Best,
-Simo

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

OAuthResponseTest.testErrorResponse:47 expected:<{"[error_uri":"
http://example-uri","error":"error","param":"value","realm":"album","state":"ok","error_description":"error_description]"}>
but
was:<{"[param":"value","error_description":"error_description","realm":"album","state":"ok","error":"error","error_uri":"
http://example-uri]"}>

  WWWAuthHeaderParametersApplierTest.testApplyOAuthParameters:60
expected:<...ope="s1 s2
s3",error[_uri="http://www.example.com/error",error="invalid_token]">
but was:<...ope="s1 s2 s3",error[="invalid_token",error_uri="
http://www.example.com/error]">
http://people.apache.org/~simonetripodi/
http://twitter.com/simonetripodi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message