oltu-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Sanso (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OLTU-164) JSON comparison in test case best practice
Date Sat, 06 Dec 2014 21:01:12 GMT

    [ https://issues.apache.org/jira/browse/OLTU-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14236971#comment-14236971

Antonio Sanso commented on OLTU-164:

[~simone.tripodi] I think the current behavior (namely sting comparison is correct). We need
to double check the signature. Bear in mind that different order means as well different signature
for JWS..

> JSON comparison in test case best practice
> ------------------------------------------
>                 Key: OLTU-164
>                 URL: https://issues.apache.org/jira/browse/OLTU-164
>             Project: Apache Oltu
>          Issue Type: Test
>            Reporter: Simone Tripodi
>            Priority: Critical
>         Attachments: OLTU-164.patch
> there are a couple of tests in the oauth-2.0/common codebase failing on CLI, but succeed
in Eclipse, see below for details...
> {noformat}
> 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]"}>
> {noformat}
> I honestly think that comparing serialised JSON strings is not the best way to assert
two JSON documents are representing exactly the same data, we need to handle that situation...
> The [jsonassert|http://jsonassert.skyscreamer.org/] library looks like to be the good
choice to assert two json object represent exactly the same data.
> If there are no objections, I would use {{jsonassert}} in all tests handling JSON data
> Thoughts? TIA! :)

This message was sent by Atlassian JIRA

View raw message