@Test public void configureValidStorageSizeFromApp() { /* Set up storage to succeed resize. */ when(mChannel.setMaxStorageSize(anyLong())).thenReturn(true); /* Configure before start. */ AppCenterFuture<Boolean> future = AppCenter.setMaxStorageSize(AppCenter.MINIMUM_STORAGE_SIZE); /* Verify the operation is still pending. */ assertFalse(future.isDone()); /* Since the call is registered, we cannot change our mind anymore. */ assertFalse(AppCenter.setMaxStorageSize(AppCenter.MINIMUM_STORAGE_SIZE + 1).get()); /* Start AppCenter. */ AppCenter.start(mApplication, DUMMY_APP_SECRET, DummyService.class); /* Verify storage size applied. */ verify(mChannel).setMaxStorageSize(AppCenter.MINIMUM_STORAGE_SIZE); /* And result returned to developer. */ assertTrue(future.get()); }