[MAGNOLIA-6856] CheckAndModifyPropertyValueTask still logs a warning even when the pre-existing value is equal to the target new value Created: 02/Nov/16  Updated: 14/Nov/16  Resolved: 07/Nov/16

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

Type: Improvement Priority: Neutral
Reporter: Oanh Thai Hoang Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 6.5h
Original Estimate: 2d

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)
Sprint: Saigon 69
Story Points: 3

 Description   

Warning log should not show when current value of property is equal with new value. Here is the unit test that run fails

    @Test
    public void existingPropertyIsReplacedAndNoLog() throws RepositoryException {
        // GIVEN
        final MockNode node = new MockNode("foo");
        node.setProperty("bar", "new-value");

        // WHEN
        final PropertyValuesTask pvd = new DummyPropertyValuesDelta();
        pvd.checkAndModifyPropertyValue(ctx, node, "bar", "expected-value", "new-value");

        // THEN
        assertEquals("new-value", node.getProperty("bar").getValue().getString());
        verify(ctx, never()).warn(anyString());
    }

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