@@ -33,6 +33,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
3333 @Test
3434 fun `test POST enkelvoudiginformatieobjecten with taal and bestandsnaam` () = testApplication {
3535 application { setup() }
36+ val client = authenticatedClient()
3637
3738 val request = generateTestDocument(taal = " dut" , bestandsnaam = " test.pdf" )
3839 val response = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
@@ -61,6 +62,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
6162 @Test
6263 fun `test GET list includes url in each result` () = testApplication {
6364 application { setup() }
65+ val client = authenticatedClient()
6466
6567 // Create two documents
6668 val req1 = generateTestDocument(taal = " dut" , bestandsnaam = " doc1.pdf" )
@@ -99,6 +101,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
99101 @Test
100102 fun `test GET enkelvoudiginformatieobjecten with invalid UUID` () = testApplication {
101103 application { setup() }
104+ val client = authenticatedClient()
102105
103106 val response = client.get(" $API_BASE /$RESOURCE_SEGMENT /invalid-uuid" )
104107
@@ -113,6 +116,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
113116 @Test
114117 fun `test GET enkelvoudiginformatieobjecten with missing UUID parameter` () = testApplication {
115118 application { setup() }
119+ val client = authenticatedClient()
116120
117121 val response = client.get(" $API_BASE /$RESOURCE_SEGMENT /" )
118122
@@ -122,6 +126,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
122126 @Test
123127 fun `test GET enkelvoudiginformatieobjecten with valid UUID after creation` () = testApplication {
124128 application { setup() }
129+ val client = authenticatedClient()
125130
126131 val request = generateTestDocument(taal = " dut" , bestandsnaam = " test.pdf" )
127132 val postResponse = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
@@ -146,6 +151,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
146151 @Test
147152 fun `HEAD enkelvoudiginformatieobjecten returns 200 for existing resource` () = testApplication {
148153 application { setup() }
154+ val client = authenticatedClient()
149155
150156 // create
151157 val created = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
@@ -164,6 +170,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
164170 @Test
165171 fun `HEAD enkelvoudiginformatieobjecten returns 404 for missing resource` () = testApplication {
166172 application { setup() }
173+ val client = authenticatedClient()
167174
168175 val resp = client.head(" $API_BASE /$RESOURCE_SEGMENT /${UUID .randomUUID()} " )
169176 assertEquals(HttpStatusCode .NotFound , resp.status)
@@ -172,6 +179,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
172179 @Test
173180 fun `HEAD enkelvoudiginformatieobjecten returns 400 for invalid UUID` () = testApplication {
174181 application { setup() }
182+ val client = authenticatedClient()
175183
176184 val resp = client.head(" $API_BASE /$RESOURCE_SEGMENT /not-a-uuid" )
177185 assertEquals(HttpStatusCode .BadRequest , resp.status)
@@ -180,6 +188,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
180188 @Test
181189 fun `DELETE enkelvoudiginformatieobjecten returns 204 and removes resource` () = testApplication {
182190 application { setup() }
191+ val client = authenticatedClient()
183192
184193 // create
185194 val created = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
@@ -201,6 +210,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
201210 @Test
202211 fun `DELETE enkelvoudiginformatieobjecten returns 404 for missing resource` () = testApplication {
203212 application { setup() }
213+ val client = authenticatedClient()
204214
205215 val del = client.delete(" $API_BASE /$RESOURCE_SEGMENT /${UUID .randomUUID()} " )
206216 assertEquals(HttpStatusCode .NotFound , del.status)
@@ -209,6 +219,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
209219 @Test
210220 fun `DELETE enkelvoudiginformatieobjecten returns 400 for invalid UUID` () = testApplication {
211221 application { setup() }
222+ val client = authenticatedClient()
212223
213224 val del = client.delete(" $API_BASE /$RESOURCE_SEGMENT /not-a-uuid" )
214225 assertEquals(HttpStatusCode .BadRequest , del.status)
@@ -217,6 +228,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
217228 @Test
218229 fun `DELETE enkelvoudiginformatieobjecten returns 409 for locked resource` () = testApplication {
219230 application { setup() }
231+ val client = authenticatedClient()
220232
221233 // create
222234 val created = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
@@ -243,6 +255,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
243255 @Test
244256 fun `test GET enkelvoudiginformatieobjecten with valid UUID returns JSON UTF-8` () = testApplication {
245257 application { setup() }
258+ val client = authenticatedClient()
246259
247260 val request = generateTestDocument(taal = " dut" , bestandsnaam = " test.pdf" )
248261 val postResponse = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
@@ -267,6 +280,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
267280 @Test
268281 fun `lock returns 200 with lock token, second lock returns 409` () = testApplication {
269282 application { setup() }
283+ val client = authenticatedClient()
270284
271285 // Create an object first
272286 val createReq = generateTestDocument()
@@ -293,6 +307,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
293307 @Test
294308 fun `unlock with correct token returns 204 and subsequent unlock returns 409` () = testApplication {
295309 application { setup() }
310+ val client = authenticatedClient()
296311
297312 // Create
298313 val createReq = generateTestDocument()
@@ -327,6 +342,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
327342 @Test
328343 fun `unlock with invalid token returns 409 Conflict` () = testApplication {
329344 application { setup() }
345+ val client = authenticatedClient()
330346
331347 // Create and lock
332348 val createReq = generateTestDocument()
@@ -350,6 +366,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
350366 @Test
351367 fun `lock and unlock with unknown UUID return 404` () = testApplication {
352368 application { setup() }
369+ val client = authenticatedClient()
353370
354371 val unknownId = " 00000000-0000-0000-0000-000000000001"
355372
@@ -369,6 +386,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
369386 @Test
370387 fun `lock and unlock with invalid UUID return 400` () = testApplication {
371388 application { setup() }
389+ val client = authenticatedClient()
372390
373391 val invalidId = " not-a-uuid"
374392
@@ -385,6 +403,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
385403 @Test
386404 fun `test zoek endpoint with uuid_In` () = testApplication {
387405 application { setup() }
406+ val client = authenticatedClient()
388407
389408 // Create two documents
390409 val req1 = generateTestDocument(identificatie = " DOC-001" )
@@ -430,6 +449,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
430449 @Test
431450 fun `test GET list paging` () = testApplication {
432451 application { setup() }
452+ val client = authenticatedClient()
433453
434454 // Create 12 documents
435455 for (i in 1 .. 12 ) {
@@ -473,6 +493,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
473493 @Test
474494 fun `test zoek endpoint paging` () = testApplication {
475495 application { setup() }
496+ val client = authenticatedClient()
476497
477498 val createdIds = mutableListOf<String >()
478499 // Create 12 documents
@@ -524,6 +545,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
524545 @Test
525546 fun `test GET list paging with custom pageSize` () = testApplication {
526547 application { setup() }
548+ val client = authenticatedClient()
527549
528550 // Create 12 documents
529551 for (i in 1 .. 12 ) {
@@ -561,6 +583,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
561583 @Test
562584 fun `test GET list paging preserves filters` () = testApplication {
563585 application { setup() }
586+ val client = authenticatedClient()
564587
565588 val bronOrganisatie = " 999999999"
566589 // Create 12 documents with specific bronorganisatie
@@ -588,6 +611,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
588611 @Test
589612 fun `test GET list with experimental object filters` () = testApplication {
590613 application { setup() }
614+ val client = authenticatedClient()
591615
592616 // Create an EIO
593617 val resEio = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
@@ -627,6 +651,7 @@ class EnkelvoudigInformatieObjectenRoutesTest : TestBase("eio_routes") {
627651 @Test
628652 fun `test POST zoek with experimental object filters` () = testApplication {
629653 application { setup() }
654+ val client = authenticatedClient()
630655
631656 // Create an EIO
632657 val resEio = client.post(" $API_BASE /$RESOURCE_SEGMENT " ) {
0 commit comments