Search in sources :

Example 31 with Response

use of com.alibaba.nacos.api.remote.response.Response in project nacos by alibaba.

the class GrpcRequestFilterTest method testFilter.

@Test
public void testFilter() throws NacosException {
    Mockito.when(upgradeJudgement.isUseGrpcFeatures()).thenReturn(true).thenReturn(false);
    Response response = grpcRequestFilter.filter(new InstanceRequest(), new RequestMeta(), InstanceRequestHandler.class);
    Assert.assertNull(response);
    try {
        grpcRequestFilter.filter(new InstanceRequest(), new RequestMeta(), InstanceRequestHandler.class);
    } catch (Exception e) {
        Assert.assertTrue(e instanceof NacosException);
    }
}
Also used : Response(com.alibaba.nacos.api.remote.response.Response) RequestMeta(com.alibaba.nacos.api.remote.request.RequestMeta) InstanceRequest(com.alibaba.nacos.api.naming.remote.request.InstanceRequest) NacosException(com.alibaba.nacos.api.exception.NacosException) NacosException(com.alibaba.nacos.api.exception.NacosException) Test(org.junit.Test)

Aggregations

Response (com.alibaba.nacos.api.remote.response.Response)31 NacosException (com.alibaba.nacos.api.exception.NacosException)23 Payload (com.alibaba.nacos.api.grpc.auto.Payload)9 ErrorResponse (com.alibaba.nacos.api.remote.response.ErrorResponse)9 Member (com.alibaba.nacos.core.cluster.Member)8 Test (org.junit.Test)7 Request (com.alibaba.nacos.api.remote.request.Request)6 RequestMeta (com.alibaba.nacos.api.remote.request.RequestMeta)6 RequestCallBack (com.alibaba.nacos.api.remote.RequestCallBack)5 ConnectionSetupRequest (com.alibaba.nacos.api.remote.request.ConnectionSetupRequest)4 ServerCheckResponse (com.alibaba.nacos.api.remote.response.ServerCheckResponse)4 DistroDataRequest (com.alibaba.nacos.naming.cluster.remote.request.DistroDataRequest)4 DistroDataResponse (com.alibaba.nacos.naming.cluster.remote.response.DistroDataResponse)4 ConnectResetRequest (com.alibaba.nacos.api.remote.request.ConnectResetRequest)3 HealthCheckRequest (com.alibaba.nacos.api.remote.request.HealthCheckRequest)3 ServerCheckRequest (com.alibaba.nacos.api.remote.request.ServerCheckRequest)3 ConnectResetResponse (com.alibaba.nacos.api.remote.response.ConnectResetResponse)3 ArrayList (java.util.ArrayList)3 LinkedList (java.util.LinkedList)3 InstanceRequest (com.alibaba.nacos.api.naming.remote.request.InstanceRequest)2