use of com.alibaba.nacos.api.naming.pojo.ServiceInfo 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()));
}
use of com.alibaba.nacos.api.naming.pojo.ServiceInfo 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));
}
use of com.alibaba.nacos.api.naming.pojo.ServiceInfo in project nacos by alibaba.
the class PushDelayTaskExecuteEngineTest method setUp.
@Before
public void setUp() throws Exception {
when(serviceStorage.getPushData(service)).thenReturn(new ServiceInfo("G@@S"));
when(indexesManager.getAllClientsSubscribeService(service)).thenReturn(Collections.singletonList(clientId));
when(clientManager.getClient(clientId)).thenReturn(client);
when(client.getSubscriber(service)).thenReturn(subscriber);
when(switchDomain.isPushEnabled()).thenReturn(true);
executeEngine = new PushDelayTaskExecuteEngine(clientManager, indexesManager, serviceStorage, metadataManager, pushExecutor, switchDomain);
}
use of com.alibaba.nacos.api.naming.pojo.ServiceInfo in project nacos by alibaba.
the class ServiceUtilTest method testSelectInstances.
@Test
public void testSelectInstances() {
ServiceInfo serviceInfo = new ServiceInfo();
serviceInfo.setGroupName("groupName");
serviceInfo.setName("serviceName");
serviceInfo.setChecksum("checkSum");
serviceInfo.setAllIPs(false);
ServiceInfo cluster = ServiceUtil.selectInstances(serviceInfo, "cluster");
assertNotNull(cluster);
}
Aggregations