Skip to content

Commit ef69c1b

Browse files
test(tool): improve map assertion to verify key-value mapping
Change-Id: I5c6222720bb9ed62e770f1c8d884a4e97e427973 Co-developed-by: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent db4a332 commit ef69c1b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

agentscope-core/src/test/java/io/agentscope/core/tool/ToolMethodInvokerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,10 @@ void testGenericMap_WithCustomClassValue() throws Exception {
742742
Assertions.assertFalse(
743743
ToolTestUtils.isErrorResponse(response), "Should not fail with ClassCastException");
744744
String content = ToolTestUtils.extractContent(response);
745-
// The order of map entries is not guaranteed, so check for both possibilities
745+
// The order of map entries is not guaranteed, so check that both key-value pairs are present.
746746
Assertions.assertTrue(
747-
content.contains("ProductA") && content.contains("ProductB"),
748-
"Response should contain both product names");
747+
content.contains("key1=ProductA") && content.contains("key2=ProductB"),
748+
"Response should contain both key-value pairs. Actual: " + content);
749749
}
750750

751751
/** Test nested generic types like List&lt;List&lt;Integer&gt;&gt;. */

0 commit comments

Comments
 (0)