Refactor Task
This commit is contained in:
18
HMCLCore/src/test/java/org/jackhuang/hmcl/util/TaskTest.java
Normal file
18
HMCLCore/src/test/java/org/jackhuang/hmcl/util/TaskTest.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package org.jackhuang.hmcl.util;
|
||||
|
||||
import org.jackhuang.hmcl.task.Task;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TaskTest {
|
||||
@Test
|
||||
public void testWhenComplete() {
|
||||
Task.composeAsync(() -> Task.allOf(
|
||||
Task.allOf(Task.runAsync(() -> {
|
||||
throw new Exception();
|
||||
}))
|
||||
)).whenComplete(((isDependentSucceeded, exception) -> {
|
||||
Assert.assertFalse(isDependentSucceeded);
|
||||
})).test();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user