This is an automated email from the ASF dual-hosted git repository.
liuhongyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new bf30e31651 Fix Order Dependent Test in AiPromptPluginDataHandlerTest
(#6245)
bf30e31651 is described below
commit bf30e31651e993ba04e52af153a9c669e0adae7c
Author: Ann (Huei) Chen <[email protected]>
AuthorDate: Wed Dec 3 02:34:24 2025 -0600
Fix Order Dependent Test in AiPromptPluginDataHandlerTest (#6245)
* fix order dependent test
* fix style
---
.../ai/prompt/handler/AiPromptPluginDataHandlerTest.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git
a/shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-prompt/src/test/java/org/apache/shenyu/plugin/ai/prompt/handler/AiPromptPluginDataHandlerTest.java
b/shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-prompt/src/test/java/org/apache/shenyu/plugin/ai/prompt/handler/AiPromptPluginDataHandlerTest.java
index 62a115f108..aa582e52f6 100644
---
a/shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-prompt/src/test/java/org/apache/shenyu/plugin/ai/prompt/handler/AiPromptPluginDataHandlerTest.java
+++
b/shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-prompt/src/test/java/org/apache/shenyu/plugin/ai/prompt/handler/AiPromptPluginDataHandlerTest.java
@@ -34,13 +34,21 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import java.util.Map;
+import java.lang.reflect.Field;
+
class AiPromptPluginDataHandlerTest {
private AiPromptPluginDataHandler handler;
@BeforeEach
- void setUp() {
+ void setUp()throws Exception {
handler = new AiPromptPluginDataHandler();
+
+ Field singles = Singleton.class.getDeclaredField("SINGLES");
+ singles.setAccessible(true);
+ Map<String, Object> map = (Map<String, Object>) singles.get(null);
+ map.clear();
}
@Test