@@ -55,15 +55,24 @@ internal class LinkHandlerTest {
5555val tests=
5656listOf (
5757Pair (mapOf (" agent" to" agent_name" )," 9a920eee-47fb-4571-9501-e4b3120c12f2" ),
58- Pair (mapOf (" agent_id" to" 9a920eee-47fb-4571-9501-e4b3120c12f2" )," 9a920eee-47fb-4571-9501-e4b3120c12f2" ),
58+ Pair (
59+ mapOf (" agent_id" to" 9a920eee-47fb-4571-9501-e4b3120c12f2" ),
60+ " 9a920eee-47fb-4571-9501-e4b3120c12f2"
61+ ),
5962Pair (mapOf (" agent" to" agent_name_2" )," fb3daea4-da6b-424d-84c7-36b90574cfef" ),
60- Pair (mapOf (" agent_id" to" fb3daea4-da6b-424d-84c7-36b90574cfef" )," fb3daea4-da6b-424d-84c7-36b90574cfef" ),
63+ Pair (
64+ mapOf (" agent_id" to" fb3daea4-da6b-424d-84c7-36b90574cfef" ),
65+ " fb3daea4-da6b-424d-84c7-36b90574cfef"
66+ ),
6167Pair (mapOf (" agent" to" agent_name_3" )," b0e4c54d-9ba9-4413-8512-11ca1e826a24" ),
62- Pair (mapOf (" agent_id" to" b0e4c54d-9ba9-4413-8512-11ca1e826a24" )," b0e4c54d-9ba9-4413-8512-11ca1e826a24" ),
63- // Prefer agent_id.
68+ Pair (
69+ mapOf (" agent_id" to" b0e4c54d-9ba9-4413-8512-11ca1e826a24" ),
70+ " b0e4c54d-9ba9-4413-8512-11ca1e826a24"
71+ ),
72+ // Prefer agent name.
6473Pair (
6574mapOf (
66- " agent" to" agent_name " ,
75+ " agent" to" agent_name_3 " ,
6776" agent_id" to" b0e4c54d-9ba9-4413-8512-11ca1e826a24" ,
6877 ),
6978" b0e4c54d-9ba9-4413-8512-11ca1e826a24" ,
@@ -89,15 +98,19 @@ internal class LinkHandlerTest {
8998Triple (mapOf (" agent" to" ws.agent_name" ),IllegalArgumentException ::class ," agent named" ),
9099Triple (mapOf (" agent" to" agent_name_4" ),IllegalArgumentException ::class ," agent named" ),
91100Triple (mapOf (" agent_id" to" not-a-uuid" ),IllegalArgumentException ::class ," agent with ID" ),
92- Triple (mapOf (" agent_id" to" ceaa7bcf-1612-45d7-b484-2e0da9349168" ),IllegalArgumentException ::class ," agent with ID" ),
93- // Will ignore agent if agent_id is set even if agent matches.
101+ Triple (
102+ mapOf (" agent_id" to" ceaa7bcf-1612-45d7-b484-2e0da9349168" ),
103+ IllegalArgumentException ::class ,
104+ " agent with ID"
105+ ),
106+ // Will ignore agent_id if agent is set even if agent_id matches.
94107Triple (
95108mapOf (
96- " agent" to" agent_name " ,
109+ " agent" to" unknown_agent_name " ,
97110" agent_id" to" ceaa7bcf-1612-45d7-b484-2e0da9349168" ,
98111 ),
99112IllegalArgumentException ::class ,
100- " agentwith ID " ,
113+ " The workspace \" ws \" does not have an agentnamed \" unknown_agent_name \" " ,
101114 ),
102115 )
103116
@@ -142,7 +155,11 @@ internal class LinkHandlerTest {
142155Triple (mapOf (" agent" to" ws" ),IllegalArgumentException ::class ," agent named" ),
143156Triple (mapOf (" agent" to" ws.agent_name_3" ),IllegalArgumentException ::class ," agent named" ),
144157Triple (mapOf (" agent" to" agent_name_4" ),IllegalArgumentException ::class ," agent named" ),
145- Triple (mapOf (" agent_id" to" ceaa7bcf-1612-45d7-b484-2e0da9349168" ),IllegalArgumentException ::class ," agent with ID" ),
158+ Triple (
159+ mapOf (" agent_id" to" ceaa7bcf-1612-45d7-b484-2e0da9349168" ),
160+ IllegalArgumentException ::class ,
161+ " agent with ID"
162+ ),
146163 )
147164
148165 tests.forEach {
@@ -166,7 +183,11 @@ internal class LinkHandlerTest {
166183Triple (mapOf (" agent" tonull ),IllegalArgumentException ::class ," has no agents" ),
167184Triple (mapOf (" agent_id" tonull ),IllegalArgumentException ::class ," has no agents" ),
168185Triple (mapOf (" agent" to" agent_name" ),IllegalArgumentException ::class ," has no agents" ),
169- Triple (mapOf (" agent_id" to" 9a920eee-47fb-4571-9501-e4b3120c12f2" ),IllegalArgumentException ::class ," has no agents" ),
186+ Triple (
187+ mapOf (" agent_id" to" 9a920eee-47fb-4571-9501-e4b3120c12f2" ),
188+ IllegalArgumentException ::class ,
189+ " has no agents"
190+ ),
170191 )
171192
172193 tests.forEach {