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);
}
}
Aggregations