完善测试用例

This commit is contained in:
Mr.Po 2021-03-16 11:06:57 +08:00
parent 35dd387cb9
commit b5e4ec9576

View File

@ -20,6 +20,7 @@ public class LazyFunLoaderTest {
LazyFunLoader<BigObject> loader = new LazyFunLoader<>(BigObject::new);
Assert.assertNotNull(loader.get());
Assert.assertTrue(loader.isInitialize());
// 对于某些对象在程序关闭时需要进行销毁操作
loader.ifInitialized(BigObject::destroy);
@ -38,5 +39,7 @@ public class LazyFunLoaderTest {
Assert.fail();
it.destroy();
});
Assert.assertFalse(loader.isInitialize());
}
}