Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-8053

Dubious JsonEqualityMatchingRule functional tests

    XMLWordPrintable

    Details

    • Task
    • Status: Dev backlog
    • Major
    • Resolution: Unresolved
    • 7.0.0
    • None
    • QA, rest
    • None

      Description

      The functional test opendj-pyforge/src/main/resources/PyBot/OpenDJ/testcases/functional/rest2ldap_json_group/JsonAttr.py contains some dubious tests which were added in the following commit: https://stash.forgerock.org/projects/QA/repos/pyforge/commits/e0b0fe1eb94007509725cb9fe4de671a6b9f4ca0#PyBot/OpenDJ/testcas[%E2%80%A6]ap_group/JsonAttr.py

      The following tests are invalid:

      • query_json_equality_simple
      • query_json_equality_complex
      • query_json_equality_more_than_one_key

      They are constructing query filters of the form jsonAttr eq "{\"name\":\"Pepe\"} but the assertion value is a string and cannot be used for representing JSON values. In fact, there is no way to represent JSON values in CREST query filters. A suitable filter would have been jsonAttr/name eq "Pepe" but this will not use the JsonEqualityMatchingRule. It will use the JsonQueryEqualityMatchingRule instead.

      I don't think it's possible to test the JsonEqualityMatchingRule over REST, I think it's only something that makes sense over LDAP. I've noticed that there seem to be some existing LDAP specific tests in opendj-pyforge/src/main/resources/PyBot/OpenDJ/testcases/functional/core_group/JsonEqualityMatchingRule.py so an acceptable fix might be to simply remove these tests. A better fix might be to instead use the JsonQueryEqualityMatchingRule which would require the Rest2Ldap config to use the "json" property mapper for jsonAttr instead of "simple".

        Attachments

          Activity

            People

            cforel carole forel
            matthew Matthew Swift
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: