From d29c4ca9c9f1252b7210af8019fbaa583f1afca2 Mon Sep 17 00:00:00 2001 From: Eric Zhao Date: Mon, 12 Nov 2018 10:19:24 +0800 Subject: [PATCH] Update gRPC adapter test cases Signed-off-by: Eric Zhao --- .../adapter/grpc/SentinelGrpcClientInterceptorTest.java | 4 ++-- .../adapter/grpc/SentinelGrpcServerInterceptorTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptorTest.java b/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptorTest.java index bc1dba73..e61dd760 100755 --- a/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptorTest.java +++ b/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptorTest.java @@ -65,14 +65,14 @@ public class SentinelGrpcClientInterceptorTest { assertTrue(sendRequest(client)); ClusterNode clusterNode = ClusterBuilderSlot.getClusterNode(resourceName, EntryType.OUT); assertNotNull(clusterNode); - assertEquals(1, clusterNode.passQps()); + assertEquals(1, clusterNode.totalRequest() - clusterNode.blockRequest()); // Not allowed to pass. configureFlowRule(0); // The second request will be blocked. assertFalse(sendRequest(client)); - assertEquals(1, clusterNode.blockQps()); + assertEquals(1, clusterNode.blockRequest()); server.stop(); } diff --git a/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcServerInterceptorTest.java b/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcServerInterceptorTest.java index da262ea3..004a2563 100755 --- a/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcServerInterceptorTest.java +++ b/sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcServerInterceptorTest.java @@ -66,14 +66,14 @@ public class SentinelGrpcServerInterceptorTest { assertTrue(sendRequest()); ClusterNode clusterNode = ClusterBuilderSlot.getClusterNode(resourceName, EntryType.IN); assertNotNull(clusterNode); - assertEquals(1, clusterNode.passQps()); + assertEquals(1, clusterNode.totalRequest() - clusterNode.blockRequest()); // Not allowed to pass. configureFlowRule(0); // The second request will be blocked. assertFalse(sendRequest()); - assertEquals(1, clusterNode.blockQps()); + assertEquals(1, clusterNode.blockRequest()); server.stop(); }