@@ -73,14 +73,15 @@ trait ArangoExamples:
73
73
val geographyCollection2 = CollectionName (" geography2" )
74
74
val countries = CollectionName (" countries" )
75
75
val continents = CollectionName (" continents" )
76
+ val continents2 = CollectionName (" continents2" )
76
77
val oceans = CollectionName (" oceans" )
77
78
val oceans2 = CollectionName (" oceans2" )
78
79
val graphEdgeDefinitions = List (GraphEdgeDefinition (allies, List (countries), List (countries)))
79
80
val graphEdgeDefinitionsGeography = List (
80
81
GraphEdgeDefinition (geographyCollection, List (continents), List (continents))
81
82
)
82
83
val graphEdgeDefinitionsGeography2 = List (
83
- GraphEdgeDefinition (geographyCollection2, List (continents ), List (continents ))
84
+ GraphEdgeDefinition (geographyCollection2, List (continents2 ), List (continents2 ))
84
85
)
85
86
val es = DocumentHandle (countries, DocumentKey (" ES" ))
86
87
val fr = DocumentHandle (countries, DocumentKey (" FR" ))
@@ -205,17 +206,30 @@ object ArangoJsonIT extends ZIOSpecDefault with ArangoExamples:
205
206
.read[Pet ]()
206
207
.flip
207
208
.debug(" test collection doesn't exist" )
208
- yield assertTrue(error.code == 404L )
209
+ yield assertTrue(
210
+ error == ArangoError (404L , true , " collection or view not found: collectionDoesntExist" , 1203L )
211
+ )
209
212
},
210
213
test(" Manage document doesn't exist when fetching document" ) {
211
214
for
212
- invalidCollection <- ArangoClientJson .collection(CollectionName (" countries" ))
213
- error <- invalidCollection
215
+ countriesCollection <- ArangoClientJson .collection(CollectionName (" countries" ))
216
+ error <- countriesCollection
214
217
.document(DocumentKey (" turtle" ))
215
218
.read[Pet ]()
216
219
.flip
217
220
.debug(" test document doesn't exist" )
218
- yield assertTrue(error.code == 404L )
221
+ yield assertTrue(error == ArangoError (404L , true , " document not found" , 1202L ))
222
+ },
223
+ test(" Manage document doesn't exist when fetching raw documents" ) {
224
+ for
225
+ countriesCollection <- ArangoClientJson .collection(CollectionName (" countries" ))
226
+ error <- countriesCollection
227
+ .document(DocumentKey (" turtle" ))
228
+ .readRaw()
229
+ .flatMap(_.via(ZPipeline .utf8Decode).run(ZSink .collectAll))
230
+ .flip
231
+ .debug(" test document raw doesn't exist" )
232
+ yield assertTrue(error == ArangoError (404L , true , " document not found" , 1202L ))
219
233
},
220
234
test(" Query documents with cursor" ) {
221
235
for
@@ -280,7 +294,7 @@ object ArangoJsonIT extends ZIOSpecDefault with ArangoExamples:
280
294
_ <- graph.removeVertexCollection(oceans2)
281
295
collectionsAfter <- graph.vertexCollections
282
296
yield assertTrue(collectionsBefore != collectionsAfter) && assertTrue(
283
- collectionsAfter == List (continents )
297
+ collectionsAfter == List (continents2 )
284
298
)
285
299
},
286
300
test(" Save and retrieve document from byte array stream" ) {
0 commit comments