@@ -173,20 +173,25 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
173
173
174
174
// Verify that there are no conversations
175
175
let request = TestRequest :: get ( )
176
- . uri ( "/api/v1 /ai/conversations" )
176
+ . uri ( "/api/v2 /ai/conversations" )
177
177
. to_request ( )
178
178
. test_auth ( "user-a" ) ;
179
179
180
180
let response = app. call_service ( request) . await ;
181
- assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
181
+ assert_eq ! (
182
+ response. status( ) ,
183
+ StatusCode :: OK ,
184
+ "response: {:?}" ,
185
+ read_text( response) . await
186
+ ) ;
182
187
183
188
let result: PaginatedResults < ConversationSummary > = read_body_json ( response) . await ;
184
189
assert_eq ! ( result. total, 0 ) ;
185
190
assert_eq ! ( result. items. len( ) , 0 ) ;
186
191
187
192
// Create a conversation
188
193
let request = TestRequest :: post ( )
189
- . uri ( "/api/v1 /ai/conversations" )
194
+ . uri ( "/api/v2 /ai/conversations" )
190
195
. to_request ( )
191
196
. test_auth ( "user-a" ) ;
192
197
@@ -208,7 +213,7 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
208
213
) ) ;
209
214
210
215
let request = TestRequest :: put ( )
211
- . uri ( format ! ( "/api/v1 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
216
+ . uri ( format ! ( "/api/v2 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
212
217
. set_json ( update1. clone ( ) )
213
218
. to_request ( )
214
219
. test_auth ( "user-a" ) ;
@@ -225,7 +230,7 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
225
230
226
231
// Verify that the conversation can be listed
227
232
let request = TestRequest :: get ( )
228
- . uri ( "/api/v1 /ai/conversations" )
233
+ . uri ( "/api/v2 /ai/conversations" )
229
234
. to_request ( )
230
235
. test_auth ( "user-a" ) ;
231
236
@@ -239,7 +244,7 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
239
244
240
245
// Verify that we can retrieve the conversation by ID
241
246
let request = TestRequest :: get ( )
242
- . uri ( format ! ( "/api/v1 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
247
+ . uri ( format ! ( "/api/v2 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
243
248
. to_request ( )
244
249
. test_auth ( "user-a" ) ;
245
250
@@ -256,7 +261,7 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
256
261
) ) ;
257
262
258
263
let request = TestRequest :: put ( )
259
- . uri ( format ! ( "/api/v1 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
264
+ . uri ( format ! ( "/api/v2 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
260
265
. append_header ( ( "if-match" , format ! ( "\" {}\" " , conversation_v2. seq) . as_str ( ) ) )
261
266
. set_json ( update2. clone ( ) )
262
267
. to_request ( )
@@ -274,7 +279,7 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
274
279
275
280
// Verify that we can retrieve the updated conversation by ID
276
281
let request = TestRequest :: get ( )
277
- . uri ( format ! ( "/api/v1 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
282
+ . uri ( format ! ( "/api/v2 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
278
283
. to_request ( )
279
284
. test_auth ( "user-a" ) ;
280
285
@@ -286,7 +291,7 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
286
291
287
292
// Verify that we can delete the conversation
288
293
let request = TestRequest :: delete ( )
289
- . uri ( format ! ( "/api/v1 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
294
+ . uri ( format ! ( "/api/v2 /ai/conversations/{}" , conversation_v1. id) . as_str ( ) )
290
295
. to_request ( )
291
296
. test_auth ( "user-a" ) ;
292
297
@@ -295,7 +300,7 @@ async fn conversation_crud(ctx: &TrustifyContext) -> anyhow::Result<()> {
295
300
296
301
// Verify that the conversation is deleted
297
302
let request = TestRequest :: get ( )
298
- . uri ( "/api/v1 /ai/conversations" )
303
+ . uri ( "/api/v2 /ai/conversations" )
299
304
. to_request ( )
300
305
. test_auth ( "user-a" ) ;
301
306
0 commit comments