Source:
public void testGenericComplexCompute4FullServiceMetadata() { DemoService server = new DemoServiceImpl(); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); URL url = URL.valueOf("dubbo://127.0.0.1:5342/" + DemoService.class.getName() + "?version=1.0.0&generic=true$timeout=3000"); Exporter<DemoService> exporter = protocol.export(proxyFactory.getInvoker(server, DemoService.class, url)); String var1 = "v1"; int var2 = 234; long l = 555; String[] var3 = {"var31", "var32"}; List<Integer> var4 = Arrays.asList(2, 4, 8); ComplexObject.TestEnum testEnum = ComplexObject.TestEnum.VALUE2; FullServiceDefinition fullServiceDefinition = ServiceDefinitionBuilder.buildFullDefinition(DemoService.class); MethodDefinition methodDefinition = getMethod("complexCompute", fullServiceDefinition.getMethods()); Map parm2= createComplexObject(fullServiceDefinition,var1, var2, l, var3, var4, testEnum); ComplexObject complexObject = map2bean(parm2); Invoker<GenericService> invoker = protocol.refer(GenericService.class, url); GenericService client = proxyFactory.getProxy(invoker, true); Object result = client.$invoke(methodDefinition.getName(), methodDefinition.getParameterTypes(), new Object[]{"haha", parm2}); Assertions.assertEquals("haha###" + complexObject.toString(), result); Invoker<DemoService> invoker2 = protocol.refer(DemoService.class, url); GenericService client2 = (GenericService) proxyFactory.getProxy(invoker2, true); Object result2 = client2.$invoke("complexCompute", methodDefinition.getParameterTypes(), new Object[]{"haha2", parm2}); Assertions.assertEquals("haha2###" + complexObject.toString(), result2); invoker.destroy(); exporter.unexport(); }

Target:
public void testGenericComplexCompute4FullServiceMetadata() { DemoService server = new DemoServiceImpl(); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); URL url = URL.valueOf("dubbo://127.0.0.1:5342/" + DemoService.class.getName() + "?version=1.0.0&generic=true$timeout=3000"); Exporter<DemoService> exporter = protocol.export(proxyFactory.getInvoker(server, DemoService.class, url)); String var1 = "v1"; int var2 = 234; long l = 555; String[] var3 = {"var31", "var32"}; List<Integer> var4 = Arrays.asList(2, 4, 8); ComplexObject.TestEnum testEnum = ComplexObject.TestEnum.VALUE2; FullServiceDefinition fullServiceDefinition = ServiceDefinitionBuilder.buildFullDefinition(DemoService.class); MethodDefinition methodDefinition = getMethod("complexCompute", fullServiceDefinition.getMethods()); Map mapObject = createComplexObject(fullServiceDefinition,var1, var2, l, var3, var4, testEnum); ComplexObject complexObject = map2bean(mapObject); Invoker<GenericService> invoker = protocol.refer(GenericService.class, url); GenericService client = proxyFactory.getProxy(invoker, true); Object result = client.$invoke(methodDefinition.getName(), methodDefinition.getParameterTypes(), new Object[]{"haha", mapObject}); Assertions.assertEquals("haha###" + complexObject.toString(), result); Invoker<DemoService> invoker2 = protocol.refer(DemoService.class, url); GenericService client2 = (GenericService) proxyFactory.getProxy(invoker2, true); Object result2 = client2.$invoke("complexCompute", methodDefinition.getParameterTypes(), new Object[]{"haha2", mapObject}); Assertions.assertEquals("haha2###" + complexObject.toString(), result2); invoker.destroy(); exporter.unexport(); }