Fix unit test error in ci
This commit is contained in:
parent
cf607a47cd
commit
7ad96444c8
@ -25,6 +25,8 @@ import org.junit.runner.RunWith;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.junit.MockitoJUnitRunner;
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
@ -48,8 +50,9 @@ public class NacosExecuteTaskExecuteEngineTest {
|
|||||||
private AbstractExecuteTask task;
|
private AbstractExecuteTask task;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAddTask() {
|
public void testAddTask() throws InterruptedException {
|
||||||
executeTaskExecuteEngine.addTask("test", task);
|
executeTaskExecuteEngine.addTask("test", task);
|
||||||
|
TimeUnit.SECONDS.sleep(1);
|
||||||
verify(task).run();
|
verify(task).run();
|
||||||
assertTrue(executeTaskExecuteEngine.isEmpty());
|
assertTrue(executeTaskExecuteEngine.isEmpty());
|
||||||
assertEquals(0, executeTaskExecuteEngine.size());
|
assertEquals(0, executeTaskExecuteEngine.size());
|
||||||
|
@ -42,7 +42,7 @@ public class HessianSerializer implements Serializer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T deserialize(byte[] data) {
|
public <T> T deserialize(byte[] data) {
|
||||||
return deserialize(data);
|
return deseiralize0(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -55,7 +55,7 @@ public class HessianSerializer implements Serializer {
|
|||||||
return deserialize(data);
|
return deserialize(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T> T deseiralize(byte[] data) {
|
private <T> T deseiralize0(byte[] data) {
|
||||||
if (ByteUtils.isEmpty(data)) {
|
if (ByteUtils.isEmpty(data)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user