Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028945Openbravo ERPA. Platformpublic2015-02-15 17:342022-02-01 08:08
inigosanchez 
Triage Platform Base 
lowtrivialhave not tried
newopen 
5
 
 
Core
No
0028945: Implement matchers for JSON objects
Implement matchers in JUnit to test and verify JSON objects.
-
See an example:

JSONObject resp = executeDSRequest(params);

    assertThat(resp, hasKeyValue("data", hasLength(greaterThan(1))));
    assertThat(
        resp,
        hasKeyValue(
            "data",
            arrayContainsElement(hasKeyValue("property",
                equalTo("salesOrder._ComputedColumns.invoiceStatus")))));
    assertThat(resp, hasKeyValue("data[0].property", equalTo("salesOrder._computedColumns")));

See a first approach in attachment diff file.[1]
No tags attached.
diff matchers.diff (24,742) 2015-02-15 17:34
https://issues.openbravo.com/file_download.php?file_id=7789&type=bug
Issue History
2015-02-15 17:34inigosanchezNew Issue
2015-02-15 17:34inigosanchezAssigned To => alostale
2015-02-15 17:34inigosanchezFile Added: matchers.diff
2015-02-15 17:34inigosanchezModules => Core
2015-02-15 17:34inigosanchezTriggers an Emergency Pack => No
2017-04-10 14:35alostaleAssigned Toalostale => platform
2022-02-01 08:08alostaleAssigned Toplatform => Triage Platform Base

There are no notes attached to this issue.