Skip to content

Commit 3545d81

Browse files
Switch to MutableInt
1 parent a393307 commit 3545d81

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/org/labkey/test/tests/component/EditableGridTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.labkey.test.tests.component;
22

33
import org.apache.commons.lang3.StringUtils;
4+
import org.apache.commons.lang3.mutable.MutableInt;
45
import org.json.JSONObject;
56
import org.junit.BeforeClass;
67
import org.junit.Ignore;
@@ -314,8 +315,8 @@ public void testDragFillSingleRow()
314315
// Get the various row heights before adding a value to the multiLine field.
315316
WebElement gridRow = Locator.tag("tr").findElements(testGrid).get(1);
316317
int rowHeightBefore = gridRow.getSize().height;
317-
var totalHeightBefore = new Object(){int size = 0; };
318-
Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightBefore.size = totalHeightBefore.size + gr.getSize().height);
318+
var totalHeightBefore = new MutableInt(0);
319+
Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightBefore.add(gr.getSize().height));
319320
WebElement topLeft = testGrid.setCellValue(0, FILL_STRING, stringValue);
320321

321322
testGrid.setCellValue(0, FILL_INT, intValue);
@@ -351,12 +352,12 @@ public void testDragFillSingleRow()
351352
testGrid.getColumnData(FILL_DATE));
352353

353354
// Check that pasting increased the size of all the rows.
354-
var totalHeightAfter = new Object(){int size = 0; };
355-
Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightAfter.size = totalHeightAfter.size + gr.getSize().height);
355+
var totalHeightAfter = new MutableInt(0);
356+
Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightAfter.add(gr.getSize().height));
356357

357358
checker().withScreenshot()
358359
.verifyTrue("The total height of all the rows should have increases after the paste.",
359-
totalHeightBefore.size + (3 * rowHeightBefore) >= totalHeightAfter.size);
360+
totalHeightBefore.intValue() + (3 * rowHeightBefore) >= totalHeightAfter.intValue());
360361
}
361362

362363
@Test

0 commit comments

Comments
 (0)