[MAGNOLIA-5357] ComponentsTestUtil setMagnoliaConfigurationProperties in Static Initializers Created: 03/Oct/13  Updated: 17/Mar/21  Resolved: 17/Mar/21

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Milan Divilek Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

info.magnolia.test.ComponentsTestUtil use Static Initializers for setMagnoliaConfigurationProperties into SystemProperty. So they are set when the class is initialized, but the problem is there is no clean way how to set them if they were clean. Only how they can be set again is call ComponentsTestUtil.clear() method. What is really ugly to setMagnoliaConfigurationProperties on clear...

This cause problem when maven do the test during build.
Example of problem:
Lets have info.magnolia.ui.form.field.transformer.composite.CompositeTransformerTest and info.magnolia.ui.form.field.factory.BasicUploadFieldFactoryTest.
Run CompositeTransformerTest as first. CompositeTransformerTest extends RepositoryTestCase. During this test is ComponentsTestUtil initialized so setMagnoliaConfigurationProperties are sets and after test tearDown is called. TearDown do SystemProperty.clear(). So MagnoliaConfigurationProperties are not set in SystemProperty for next tests.
Run BasicUploadFieldFactoryTest MagnoliaConfigurationProperties are not set and also ComponentsTestUtil was already initialized so Static Initializers is not call. This cause fail of BasicUploadFieldFactoryTest.


Generated at Mon Feb 12 04:04:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.