Skip to content

Commit

Permalink
Apply style suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndiritu committed Sep 11, 2024
1 parent 70bc888 commit cb64a81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public void setIsInitializationCompleted(final boolean value) {
BackedModel backedModel = (BackedModel) item;
backedModel
.getBackingStore()
.setIsInitializationCompleted(value); // propagate initialization
.setIsInitializationCompleted(
value); // propagate initialization
}
}
}
Expand Down Expand Up @@ -112,9 +113,7 @@ public void setReturnOnlyChangedValues(final boolean value) {
for (final Object item : items) {
if (item instanceof BackedModel) {
BackedModel backedModel = (BackedModel) item;
backedModel
.getBackingStore()
.setReturnOnlyChangedValues(value);
backedModel.getBackingStore().setReturnOnlyChangedValues(value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ void testInitializationCompletedIsPropagatedToCollectionItems() {
for (TestEntity colleague : testUser.getValue()) {
assertTrue(colleague.getBackingStore().getIsInitializationCompleted());
}

}

@Test
Expand Down Expand Up @@ -555,15 +554,17 @@ void testCollectionPropertyConsistencyChecksSizeChangesInAllNestedItemsInCollect
testUser.getBackingStore().setReturnOnlyChangedValues(false);
testUser.getColleagues().get(9).getAdditionalData().put("moreRandom", 123);

// collection consistency should loop through all nested backed models in the collection and find one with a dirty additional data map
// collection consistency should loop through all nested backed models in the collection and
// find one with a dirty additional data map
testUser.getBackingStore().setReturnOnlyChangedValues(true);
assertNotNull(testUser.getColleagues());
var changedValues = testUser.getBackingStore().enumerate();
assertEquals(1, changedValues.size());
}

@Test
void testCollectionPropertyConsistencyChecksEnumeratesNestedBackedModelsInAllNestedCollections() {
void
testCollectionPropertyConsistencyChecksEnumeratesNestedBackedModelsInAllNestedCollections() {
var colleagues = new ArrayList<TestEntity>();
for (int i = 0; i < 10; i++) {
var colleague = new TestEntity();
Expand All @@ -589,9 +590,12 @@ void testCollectionPropertyConsistencyChecksEnumeratesNestedBackedModelsInAllNes

// Update nested backed model
testUser.getBackingStore().setReturnOnlyChangedValues(false);
((TestEntity) testUser.getColleagues().get(9).getAdditionalData().get("manager")).getAdditionalData().put("moreRandom", 123);
((TestEntity) testUser.getColleagues().get(9).getAdditionalData().get("manager"))
.getAdditionalData()
.put("moreRandom", 123);

// collection consistency should loop through all nested backed models in the collection and find one with a dirty additional data map
// collection consistency should loop through all nested backed models in the collection and
// find one with a dirty additional data map
testUser.getBackingStore().setReturnOnlyChangedValues(true);
var changedValues = testUser.getBackingStore().enumerate();
assertNotNull(testUser.getColleagues());
Expand Down

0 comments on commit cb64a81

Please sign in to comment.