Search in sources :

Example 41 with ServiceMetadata

use of com.alibaba.nacos.naming.core.v2.metadata.ServiceMetadata in project nacos by alibaba.

the class PushExecutorRpcImplTest method setUp.

@Before
public void setUp() throws Exception {
    serviceMetadata = new ServiceMetadata();
    pushData = new PushDataWrapper(serviceMetadata, new ServiceInfo("G@@S"));
    pushExecutor = new PushExecutorRpcImpl(pushService);
    doAnswer(new CallbackAnswer()).when(pushService).pushWithCallback(eq(rpcClientId), any(NotifySubscriberRequest.class), eq(pushCallBack), eq(GlobalExecutor.getCallbackExecutor()));
}
Also used : PushDataWrapper(com.alibaba.nacos.naming.push.v2.PushDataWrapper) ServiceInfo(com.alibaba.nacos.api.naming.pojo.ServiceInfo) NotifySubscriberRequest(com.alibaba.nacos.api.naming.remote.request.NotifySubscriberRequest) ServiceMetadata(com.alibaba.nacos.naming.core.v2.metadata.ServiceMetadata) Before(org.junit.Before)

Example 42 with ServiceMetadata

use of com.alibaba.nacos.naming.core.v2.metadata.ServiceMetadata in project nacos by alibaba.

the class PushExecutorUdpImplTest method setUp.

@Before
public void setUp() throws Exception {
    serviceMetadata = new ServiceMetadata();
    pushData = new PushDataWrapper(serviceMetadata, new ServiceInfo("G@@S"));
    pushExecutor = new PushExecutorUdpImpl(pushService);
    doAnswer(new CallbackAnswer()).when(pushService).pushDataWithCallback(eq(subscriber), any(ServiceInfo.class), eq(pushCallBack));
}
Also used : PushDataWrapper(com.alibaba.nacos.naming.push.v2.PushDataWrapper) ServiceInfo(com.alibaba.nacos.api.naming.pojo.ServiceInfo) ServiceMetadata(com.alibaba.nacos.naming.core.v2.metadata.ServiceMetadata) Before(org.junit.Before)

Aggregations

ServiceMetadata (com.alibaba.nacos.naming.core.v2.metadata.ServiceMetadata)33 Service (com.alibaba.nacos.naming.core.v2.pojo.Service)18 Test (org.junit.Test)13 ServiceInfo (com.alibaba.nacos.api.naming.pojo.ServiceInfo)11 ClusterMetadata (com.alibaba.nacos.naming.core.v2.metadata.ClusterMetadata)8 NacosException (com.alibaba.nacos.api.exception.NacosException)7 Secured (com.alibaba.nacos.auth.annotation.Secured)7 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)6 Instance (com.alibaba.nacos.api.naming.pojo.Instance)5 NamingMetadataOperateService (com.alibaba.nacos.naming.core.v2.metadata.NamingMetadataOperateService)4 PushDataWrapper (com.alibaba.nacos.naming.push.v2.PushDataWrapper)4 Before (org.junit.Before)4 ServiceDetailInfo (com.alibaba.nacos.naming.pojo.ServiceDetailInfo)3 HashMap (java.util.HashMap)3 PutMapping (org.springframework.web.bind.annotation.PutMapping)3 RequestMeta (com.alibaba.nacos.api.remote.request.RequestMeta)2 Serializer (com.alibaba.nacos.consistency.Serializer)2 Cluster (com.alibaba.nacos.naming.core.Cluster)2 NamingMetadataManager (com.alibaba.nacos.naming.core.v2.metadata.NamingMetadataManager)2 InstancePublishInfo (com.alibaba.nacos.naming.core.v2.pojo.InstancePublishInfo)2