diff --git a/core/src/test/java/org/apache/servicecomb/core/transport/TestAbstractTransport.java b/core/src/test/java/org/apache/servicecomb/core/transport/TestAbstractTransport.java
index b0fd7ba0c4b..c43ea62b110 100644
--- a/core/src/test/java/org/apache/servicecomb/core/transport/TestAbstractTransport.java
+++ b/core/src/test/java/org/apache/servicecomb/core/transport/TestAbstractTransport.java
@@ -18,7 +18,6 @@
package org.apache.servicecomb.core.transport;
import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
@@ -26,27 +25,12 @@
import org.apache.servicecomb.core.Invocation;
import org.apache.servicecomb.foundation.common.net.IpPort;
import org.apache.servicecomb.foundation.vertx.VertxUtils;
-import org.apache.servicecomb.registry.RegistrationManager;
import org.apache.servicecomb.swagger.invocation.AsyncResponse;
import org.junit.AfterClass;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
-import org.springframework.util.ReflectionUtils;
-
-import com.netflix.config.DynamicProperty;
-
-import mockit.Expectations;
-import mockit.Mocked;
public class TestAbstractTransport {
- private final Method updatePropertyMethod =
- ReflectionUtils.findMethod(DynamicProperty.class, "updateProperty", String.class, Object.class);
-
- private void updateProperty(String key, Object value) {
- updatePropertyMethod.setAccessible(true);
- ReflectionUtils.invokeMethod(updatePropertyMethod, null, key, value);
- }
-
static class MyAbstractTransport extends AbstractTransport {
@Override
@@ -71,12 +55,6 @@ public static void classTeardown() {
@Test
public void testSetListenAddressWithoutSchemaChineseSpaceNewSC() throws UnsupportedEncodingException {
- new Expectations() {
- {
- RegistrationManager.getPublishAddress("my", "127.0.0.1:9090");
- }
- };
-
MyAbstractTransport transport = new MyAbstractTransport();
transport.setListenAddressWithoutSchema("127.0.0.1:9090", Collections.singletonMap("country", "中 国"));
Assertions.assertEquals("my://127.0.0.1:9090?country=" + URLEncoder.encode("中 国", StandardCharsets.UTF_8.name()),
@@ -113,7 +91,7 @@ public void testMyAbstractTransport() {
}
@Test(expected = IllegalArgumentException.class)
- public void testMyAbstractTransportException(@Mocked TransportManager manager) {
+ public void testMyAbstractTransportException() {
MyAbstractTransport transport = new MyAbstractTransport();
transport.setListenAddressWithoutSchema(":127.0.0.1:9090");
diff --git a/dependencies/default/pom.xml b/dependencies/default/pom.xml
index 517c648e605..c8c251de368 100644
--- a/dependencies/default/pom.xml
+++ b/dependencies/default/pom.xml
@@ -78,7 +78,7 @@
5.14.0
2.2.0
0.3.0
- 4.1.110.Final
+ 4.1.112.Final
4.10.0
0.16.0
3.21.12
@@ -98,7 +98,7 @@
2.7.18
1.6.9
1.3.3
- 4.4.9
+ 4.5.9
2.24.0
2.16.3
diff --git a/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java b/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
index eb25a08f56f..9a6f0ce383c 100644
--- a/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
+++ b/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
@@ -16,20 +16,39 @@
*/
package io.vertx.core.impl;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
+import io.netty.channel.EventLoop;
+import io.vertx.codegen.annotations.Nullable;
import io.vertx.core.AsyncResult;
+import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Promise;
+import io.vertx.core.ThreadingModel;
+import io.vertx.core.json.JsonObject;
+import io.vertx.core.spi.tracing.VertxTracer;
+
+/**
+ * This class is created to make vertx unit test easier
+ */
+@SuppressWarnings({"rawtypes"})
+public class SyncContext extends ContextBase implements ContextInternal {
+ private static final long serialVersionUID = -6209656149925076980L;
-public class SyncContext extends EventLoopContext {
protected VertxInternal owner;
+ protected Executor executor = Executors.newSingleThreadExecutor();
+
public SyncContext() {
- this(null);
+ this(0);
}
- public SyncContext(VertxInternal vertx) {
- super(vertx, null, null, null, null, null, null);
+ public SyncContext(int localsLength) {
+ super(localsLength);
}
@Override
@@ -37,15 +56,76 @@ public VertxInternal owner() {
return owner;
}
- public void setOwner(VertxInternal owner) {
- this.owner = owner;
+ @Override
+ public Context exceptionHandler(@Nullable Handler handler) {
+ return null;
+ }
+
+ @Override
+ public @Nullable Handler exceptionHandler() {
+ return null;
+ }
+
+ @Override
+ public boolean inThread() {
+ return false;
+ }
+
+ @Override
+ public void emit(T t, Handler handler) {
+
+ }
+
+ @Override
+ public void execute(Runnable runnable) {
+
+ }
+
+ @Override
+ public void execute(T t, Handler handler) {
+
+ }
+
+ @Override
+ public void reportException(Throwable throwable) {
+
+ }
+
+ @Override
+ public ConcurrentMap