Fix unit test error in ci

This commit is contained in:
KomachiSion 2020-10-21 10:42:50 +08:00
parent cf607a47cd
commit 7ad96444c8
2 changed files with 6 additions and 3 deletions

View File

@ -25,6 +25,8 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.verify;
@ -48,8 +50,9 @@ public class NacosExecuteTaskExecuteEngineTest {
private AbstractExecuteTask task;
@Test
public void testAddTask() {
public void testAddTask() throws InterruptedException {
executeTaskExecuteEngine.addTask("test", task);
TimeUnit.SECONDS.sleep(1);
verify(task).run();
assertTrue(executeTaskExecuteEngine.isEmpty());
assertEquals(0, executeTaskExecuteEngine.size());

View File

@ -42,7 +42,7 @@ public class HessianSerializer implements Serializer {
@Override
public <T> T deserialize(byte[] data) {
return deserialize(data);
return deseiralize0(data);
}
@Override
@ -55,7 +55,7 @@ public class HessianSerializer implements Serializer {
return deserialize(data);
}
private <T> T deseiralize(byte[] data) {
private <T> T deseiralize0(byte[] data) {
if (ByteUtils.isEmpty(data)) {
return null;
}