From f28f5c9a019d9e075194b70f3df172931e5d6fcf Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Wed, 20 Jan 2021 21:37:29 +1300 Subject: [PATCH] #2146 - no change - Tidy test only TestWithCacheAndLazyLoad --- .../TestWithCacheAndLazyLoad.java | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/ebean-core/src/test/java/org/tests/model/lazywithcache/TestWithCacheAndLazyLoad.java b/ebean-core/src/test/java/org/tests/model/lazywithcache/TestWithCacheAndLazyLoad.java index e245fea79..ce5d35b26 100644 --- a/ebean-core/src/test/java/org/tests/model/lazywithcache/TestWithCacheAndLazyLoad.java +++ b/ebean-core/src/test/java/org/tests/model/lazywithcache/TestWithCacheAndLazyLoad.java @@ -13,42 +13,40 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Noemi Szemenyei, FOCONIS AG * */ - public class TestWithCacheAndLazyLoad extends BaseTestCase{ @Test public void testGetters() { - + ChildWithCache child = new ChildWithCache(); child.setId(1L); child.setName("Child With Cache"); child.setAddress("Address"); DB.save(child); - + ParentA parentA = new ParentA(); parentA.setId(1L); parentA.setName("Parent A"); parentA.setChild(child); DB.save(parentA); - + ParentB parentB = new ParentB(); parentB.setId(1L); parentB.setChild(child); DB.save(parentB); - - + + ParentA tempA = DB.find(ParentA.class, 1L); - tempA.getChild().getName(); //load name - + tempA.getChild().getName(); // load name + ParentB tempB = DB.find(ParentB.class, 1L); - + ChildWithCache temp = tempB.getChild(); - //if the next line is commented out, the test passes - temp.getName(); //load name from cache --> ebean_intercept.loadedFromCache = true - - String tempLazyProp = temp.getAddress(); - assertThat(tempLazyProp).isEqualTo("Address"); - + // if the next line is commented out, the test passes + temp.getName(); // load name from cache --> ebean_intercept.loadedFromCache = true + + assertThat(temp.getAddress()).isEqualTo("Address"); + assertThat(temp.getName()).isEqualTo("Child With Cache"); } }