use of org.apache.shenyu.common.dto.MetaData in project incubator-shenyu by apache.
the class AlibabaDubboConfigCacheTest method testInitRef.
@Test
public void testInitRef() {
MetaData metaData = new MetaData();
metaData.setPath("/test");
AlibabaDubboConfigCache alibabaDubboConfigCacheMock = mock(AlibabaDubboConfigCache.class);
when(alibabaDubboConfigCacheMock.initRef(metaData)).thenReturn(new ReferenceConfig<>());
assertNotNull(alibabaDubboConfigCacheMock.initRef(metaData));
}
use of org.apache.shenyu.common.dto.MetaData in project incubator-shenyu by apache.
the class AlibabaDubboConfigCacheTest method testBuild.
@Test
public void testBuild() {
DubboParam dubboParam = new DubboParam();
dubboParam.setVersion("2.6.5");
dubboParam.setGroup("Group");
dubboParam.setUrl("http://192.168.55.113/dubbo");
MetaData metaData = new MetaData();
metaData.setRpcExt(GsonUtils.getInstance().toJson(dubboParam));
AlibabaDubboConfigCache alibabaDubboConfigCacheMock = mock(AlibabaDubboConfigCache.class);
when(alibabaDubboConfigCacheMock.build(metaData)).thenReturn(new ReferenceConfig<>());
assertNotNull(alibabaDubboConfigCacheMock.build(metaData));
}
use of org.apache.shenyu.common.dto.MetaData in project incubator-shenyu by apache.
the class AlibabaDubboPluginDataTest method setUp.
@BeforeEach
public void setUp() {
alibabaDubboPluginDataHandler = new AlibabaDubboPluginDataHandler();
MetaData metaData = new MetaData();
metaData.setId("1332017966661636096");
metaData.setAppName("dubbo");
metaData.setPath("/dubbo/findAll");
metaData.setServiceName("org.apache.shenyu.test.dubbo.api.service.DubboTestService");
metaData.setMethodName("findAll");
assertNotNull(metaData);
}
use of org.apache.shenyu.common.dto.MetaData in project incubator-shenyu by apache.
the class SofaMetaDataSubscriber method onSubscribe.
@Override
public void onSubscribe(final MetaData metaData) {
if (RpcTypeEnum.SOFA.getName().equals(metaData.getRpcType())) {
MetaData exist = META_DATA.get(metaData.getPath());
if (Objects.isNull(exist) || Objects.isNull(ApplicationConfigCache.getInstance().get(exist.getPath()).refer())) {
// The first initialization
ApplicationConfigCache.getInstance().initRef(metaData);
} else {
if (!exist.getServiceName().equals(metaData.getServiceName()) || !exist.getRpcExt().equals(metaData.getRpcExt())) {
// update
ApplicationConfigCache.getInstance().build(metaData);
}
}
META_DATA.put(metaData.getPath(), metaData);
}
}
use of org.apache.shenyu.common.dto.MetaData in project incubator-shenyu by apache.
the class SofaProxyServiceTest method setup.
@BeforeEach
public void setup() {
exchange = MockServerWebExchange.from(MockServerHttpRequest.get("localhost").build());
metaData = new MetaData();
metaData.setId("1332017966661636096");
metaData.setAppName("sofa");
metaData.setPath(PATH);
metaData.setServiceName("org.apache.shenyu.test.dubbo.api.service.DubboTestService");
metaData.setMethodName(METHOD_NAME);
metaData.setRpcType(RpcTypeEnum.SOFA.getName());
}
Aggregations