diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/store/InMemoryBackingStore.java b/components/abstractions/src/main/java/com/microsoft/kiota/store/InMemoryBackingStore.java index 0eec9b953..43d49fb27 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/store/InMemoryBackingStore.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/store/InMemoryBackingStore.java @@ -80,7 +80,8 @@ public void setIsInitializationCompleted(final boolean value) { BackedModel backedModel = (BackedModel) item; backedModel .getBackingStore() - .setIsInitializationCompleted(value); // propagate initialization + .setIsInitializationCompleted( + value); // propagate initialization } } } @@ -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); } } } diff --git a/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java b/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java index c1bf48961..39f97e711 100644 --- a/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java +++ b/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java @@ -465,22 +465,6 @@ void TestsBackingStoreUpdateToItemInNestedCollectionWithAnotherBackedModel() { .containsKey("manager")); } - @Test - void testLargeArraysPerformsWell() { - // Arrange - var testBackingStore = new InMemoryBackingStore(); - // Act - assertTrue(testBackingStore.enumerate().isEmpty()); - var testArray = new int[100000000]; - testBackingStore.set("values", testArray); - long startTimeMillis = System.currentTimeMillis(); - testBackingStore.setIsInitializationCompleted(true); - long timeTakenMillis = System.currentTimeMillis() - startTimeMillis; - - // Assert - assertTrue(timeTakenMillis < 1); - } - @Test void testInitializationCompletedIsPropagatedToMapItems() { var colleagues = new HashMap(); @@ -523,7 +507,6 @@ void testInitializationCompletedIsPropagatedToCollectionItems() { for (TestEntity colleague : testUser.getValue()) { assertTrue(colleague.getBackingStore().getIsInitializationCompleted()); } - } @Test @@ -555,7 +538,8 @@ 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(); @@ -563,7 +547,8 @@ void testCollectionPropertyConsistencyChecksSizeChangesInAllNestedItemsInCollect } @Test - void testCollectionPropertyConsistencyChecksEnumeratesNestedBackedModelsInAllNestedCollections() { + void + testCollectionPropertyConsistencyChecksEnumeratesNestedBackedModelsInAllNestedCollections() { var colleagues = new ArrayList(); for (int i = 0; i < 10; i++) { var colleague = new TestEntity(); @@ -589,9 +574,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());