use of com.alibaba.nacos.api.naming.remote.response.NotifySubscriberResponse in project nacos by alibaba.
the class NamingPushRequestHandlerTest method testRequestReply.
@Test
public void testRequestReply() {
// given
ServiceInfoHolder holder = mock(ServiceInfoHolder.class);
NamingPushRequestHandler handler = new NamingPushRequestHandler(holder);
ServiceInfo info = new ServiceInfo("name", "cluster1");
Request req = NotifySubscriberRequest.buildNotifySubscriberRequest(info);
// when
Response response = handler.requestReply(req);
// then
Assert.assertTrue(response instanceof NotifySubscriberResponse);
verify(holder, times(1)).processServiceInfo(info);
}
use of com.alibaba.nacos.api.naming.remote.response.NotifySubscriberResponse in project nacos by alibaba.
the class NamingPushRequestHandler method requestReply.
@Override
public Response requestReply(Request request) {
if (request instanceof NotifySubscriberRequest) {
NotifySubscriberRequest notifyResponse = (NotifySubscriberRequest) request;
serviceInfoHolder.processServiceInfo(notifyResponse.getServiceInfo());
return new NotifySubscriberResponse();
}
return null;
}
Aggregations