@@ -55,15 +55,24 @@ internal class LinkHandlerTest {
55
55
val tests =
56
56
listOf (
57
57
Pair (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
+ ),
59
62
Pair (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
+ ),
61
67
Pair (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.
64
73
Pair (
65
74
mapOf (
66
- " agent" to " agent_name " ,
75
+ " agent" to " agent_name_3 " ,
67
76
" agent_id" to " b0e4c54d-9ba9-4413-8512-11ca1e826a24" ,
68
77
),
69
78
" b0e4c54d-9ba9-4413-8512-11ca1e826a24" ,
@@ -89,15 +98,19 @@ internal class LinkHandlerTest {
89
98
Triple (mapOf (" agent" to " ws.agent_name" ), IllegalArgumentException ::class , " agent named" ),
90
99
Triple (mapOf (" agent" to " agent_name_4" ), IllegalArgumentException ::class , " agent named" ),
91
100
Triple (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.
94
107
Triple (
95
108
mapOf (
96
- " agent" to " agent_name " ,
109
+ " agent" to " unknown_agent_name " ,
97
110
" agent_id" to " ceaa7bcf-1612-45d7-b484-2e0da9349168" ,
98
111
),
99
112
IllegalArgumentException ::class ,
100
- " agent with ID " ,
113
+ " The workspace \" ws \" does not have an agent named \" unknown_agent_name \" " ,
101
114
),
102
115
)
103
116
@@ -142,7 +155,11 @@ internal class LinkHandlerTest {
142
155
Triple (mapOf (" agent" to " ws" ), IllegalArgumentException ::class , " agent named" ),
143
156
Triple (mapOf (" agent" to " ws.agent_name_3" ), IllegalArgumentException ::class , " agent named" ),
144
157
Triple (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
+ ),
146
163
)
147
164
148
165
tests.forEach {
@@ -166,7 +183,11 @@ internal class LinkHandlerTest {
166
183
Triple (mapOf (" agent" to null ), IllegalArgumentException ::class , " has no agents" ),
167
184
Triple (mapOf (" agent_id" to null ), IllegalArgumentException ::class , " has no agents" ),
168
185
Triple (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
+ ),
170
191
)
171
192
172
193
tests.forEach {
0 commit comments