@@ -54,16 +54,21 @@ internal class LinkHandlerTest {
54
54
55
55
val tests =
56
56
listOf (
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" ),
59
- 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" ),
61
- 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" ),
57
+ Pair (
58
+ mapOf (" agent_id" to " 9a920eee-47fb-4571-9501-e4b3120c12f2" ),
59
+ " 9a920eee-47fb-4571-9501-e4b3120c12f2"
60
+ ),
61
+ Pair (
62
+ mapOf (" agent_id" to " fb3daea4-da6b-424d-84c7-36b90574cfef" ),
63
+ " fb3daea4-da6b-424d-84c7-36b90574cfef"
64
+ ),
65
+ Pair (
66
+ mapOf (" agent_id" to " b0e4c54d-9ba9-4413-8512-11ca1e826a24" ),
67
+ " b0e4c54d-9ba9-4413-8512-11ca1e826a24"
68
+ ),
63
69
// Prefer agent_id.
64
70
Pair (
65
71
mapOf (
66
- " agent" to " agent_name" ,
67
72
" agent_id" to " b0e4c54d-9ba9-4413-8512-11ca1e826a24" ,
68
73
),
69
74
" b0e4c54d-9ba9-4413-8512-11ca1e826a24" ,
@@ -81,15 +86,14 @@ internal class LinkHandlerTest {
81
86
val tests =
82
87
listOf (
83
88
Triple (emptyMap(), MissingArgumentException ::class , " Unable to determine" ),
84
- Triple (mapOf (" agent" to " " ), MissingArgumentException ::class , " Unable to determine" ),
85
89
Triple (mapOf (" agent_id" to " " ), MissingArgumentException ::class , " Unable to determine" ),
86
- Triple (mapOf (" agent" to null ), MissingArgumentException ::class , " Unable to determine" ),
87
90
Triple (mapOf (" agent_id" to null ), MissingArgumentException ::class , " Unable to determine" ),
88
- Triple (mapOf (" agent" to " ws" ), IllegalArgumentException ::class , " agent named" ),
89
- Triple (mapOf (" agent" to " ws.agent_name" ), IllegalArgumentException ::class , " agent named" ),
90
- Triple (mapOf (" agent" to " agent_name_4" ), IllegalArgumentException ::class , " agent named" ),
91
91
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" ),
92
+ Triple (
93
+ mapOf (" agent_id" to " ceaa7bcf-1612-45d7-b484-2e0da9349168" ),
94
+ IllegalArgumentException ::class ,
95
+ " agent with ID"
96
+ ),
93
97
// Will ignore agent if agent_id is set even if agent matches.
94
98
Triple (
95
99
mapOf (
@@ -139,10 +143,11 @@ internal class LinkHandlerTest {
139
143
val ws = DataGen .workspace(" ws" , agents = oneAgent)
140
144
val tests =
141
145
listOf (
142
- Triple (mapOf (" agent" to " ws" ), IllegalArgumentException ::class , " agent named" ),
143
- Triple (mapOf (" agent" to " ws.agent_name_3" ), IllegalArgumentException ::class , " agent named" ),
144
- 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" ),
146
+ Triple (
147
+ mapOf (" agent_id" to " ceaa7bcf-1612-45d7-b484-2e0da9349168" ),
148
+ IllegalArgumentException ::class ,
149
+ " agent with ID"
150
+ ),
146
151
)
147
152
148
153
tests.forEach {
@@ -166,7 +171,11 @@ internal class LinkHandlerTest {
166
171
Triple (mapOf (" agent" to null ), IllegalArgumentException ::class , " has no agents" ),
167
172
Triple (mapOf (" agent_id" to null ), IllegalArgumentException ::class , " has no agents" ),
168
173
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" ),
174
+ Triple (
175
+ mapOf (" agent_id" to " 9a920eee-47fb-4571-9501-e4b3120c12f2" ),
176
+ IllegalArgumentException ::class ,
177
+ " has no agents"
178
+ ),
170
179
)
171
180
172
181
tests.forEach {
0 commit comments