Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049226Openbravo ERPA. Platformpublic2022-05-05 11:092022-05-06 10:51
caristu 
caristu 
highminorhave not tried
closedfixed 
5
 
PR22Q3 
Core
No
0049226: matchesObject should fail if there are missing properties in actual
Given:

  actual = { p1: 1, p2: 2, p4: 4 }
  expected = { p1: 1, p2: 2, p3: 3 }

Then:

  assertThat(actual, matchesObject(expected)) must be false.

But currently this is not being asserted correctly as it returns true because when having the same number of properties only the common properties (p1 and p2 in this example) are taken into account.
.
No tags attached.
related to feature request 0048373 closed caristu Provide test matchers for asserting JSON objects 
Issue History
2022-05-05 11:09caristuNew Issue
2022-05-05 11:09caristuAssigned To => caristu
2022-05-05 11:09caristuModules => Core
2022-05-05 11:09caristuTriggers an Emergency Pack => No
2022-05-05 11:09caristuIssue generated from0049170
2022-05-05 11:09caristuRelationship addedrelated to 0049170
2022-05-05 11:11caristuSummarymatchesObject should fail if there are properties missing in actual => matchesObject should fail if there are missing properties in actual
2022-05-05 11:12hgbotNote Added: 0136968
2022-05-05 16:43hgbotNote Added: 0136985
2022-05-06 10:51hgbotResolutionopen => fixed
2022-05-06 10:51hgbotStatusnew => closed
2022-05-06 10:51hgbotNote Added: 0137018
2022-05-06 10:51hgbotFixed in Version => PR22Q3
2022-05-06 10:51hgbotNote Added: 0137019
2022-05-18 11:41caristuRelationship deletedrelated to 0049170
2022-05-18 11:41caristuRelationship addedrelated to 0048373

Notes
(0136968)
hgbot   
2022-05-05 11:12   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/583 [^]
(0136985)
hgbot   
2022-05-05 16:43   
Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests [^]
Changeset: cd8d2f253e907cb955ddc0abf901c9db1d795899
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 05-05-2022 15:52:14
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests/-/commit/cd8d2f253e907cb955ddc0abf901c9db1d795899 [^]

related to BUG-49226: fix tests failing due to missing props

---
M src-test/data/export/filter/product/ProductByComplementaryProduct.json
M src-test/data/export/filter/product/ProductByMultiUPC.json
---
(0137018)
hgbot   
2022-05-06 10:51   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/583 [^]
(0137019)
hgbot   
2022-05-06 10:51   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: d7eef69a7a2e50db561e2e3446d6eeb91b469ac4
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 06-05-2022 08:51:14
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/d7eef69a7a2e50db561e2e3446d6eeb91b469ac4 [^]

fixes BUG-49226: matchesObject should fail if there are missing props in actual

---
M src-test/src/org/openbravo/test/matchers/json/JSONMatcher.java
M src-test/src/org/openbravo/test/matchers/json/JSONMatchersTest.java
---