[MGNLUI-6388] Convert NodeDeepEqualsAssertBuilder into a Matcher and implement missing parts Created: 04/Nov/20  Updated: 04/Nov/20

Status: Open
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Šimon Demočko Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split from MGNLUI-6253 Allow MultiFields using jcrChildNodeP... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

Current situation

NodeDeepEqualsAssertBuilder was introduced in MGNLUI-6253 to allow asserting node structures - this allows building tests using imported yamls - much easier to read/write parameterized tests in a before/after fashion.

Desired situation

  • implement TODOs
    • Fetch locales from nodes so the user does not need to input used Locales in YAML.
      • Such YAMLs shouldn't ever be so long that it would be a performance issue. In case a test would need such a long YAML, they could provide the locales as a fallback as it is done now and the locales lookup would happen only if they are not provided.
  • Implement order insensitive equals assertion (there's the UnsupportedOperationException thrown)
  • you can try reusing this code or get inspiration from it
    • info/magnolia/module/workflow/setup/WorkflowCompatibilityVersionHandlerTest.java#454{{}}
      {{}}
    • info.magnolia.importexport.command.JcrImportExportCommandTest#hasSameStructure
  • Replace usages of the two methods mentioned above with this implementation
  • It would be nice if we could use assertThat fluently with a matcher instead of having a custom Util assertion builder. Try to convert it into a matcher without compromising the configurability of the assertion.
  • move to core

Generated at Mon Feb 12 09:35:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.