@@ -3,7 +3,7 @@ mod common;
33use bytes:: Bytes ;
44use common:: MockS3Backend ;
55use common:: helpers:: * ;
6- use s3_cache:: { CacheKey , CachingProxy } ;
6+ use s3_cache:: { CacheKey , S3CachingProxy } ;
77use s3s:: S3 ;
88
99#[ tokio:: test]
@@ -16,7 +16,7 @@ async fn get_object_cache_miss_then_hit() {
1616
1717 // Setup: Cache + Proxy
1818 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
19- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
19+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
2020
2121 // First request: cache miss
2222 let req = build_get_request ( "test-bucket" , "key.txt" , None ) ;
@@ -49,7 +49,7 @@ async fn cache_ttl_expiration() {
4949
5050 // Cache with 60 second TTL
5151 let cache = create_test_cache ( 100 , usize:: MAX , 60 ) ;
52- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
52+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
5353
5454 // First request: populate cache
5555 let req = build_get_request ( "test-bucket" , "expiring.txt" , None ) ;
@@ -87,7 +87,7 @@ async fn cache_size_eviction() {
8787
8888 // Cache with room for only 5 entries
8989 let cache = create_test_cache ( 5 , usize:: MAX , 300 ) ;
90- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
90+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
9191
9292 // Fetch all 10 objects
9393 for i in 0 ..10 {
@@ -138,7 +138,7 @@ async fn cache_object_count_limit() {
138138
139139 // Cache limited to 10 entries
140140 let cache = create_test_cache ( 10 , usize:: MAX , 300 ) ;
141- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
141+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
142142
143143 // Fetch 15 objects
144144 for i in 0 ..15 {
@@ -183,7 +183,7 @@ async fn oversized_object_not_cached() {
183183
184184 // Cache with max size 100KB
185185 let cache = create_test_cache ( 100 , 100_000 , 300 ) ;
186- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
186+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
187187
188188 // First request: object too large, streams through without caching
189189 let req = build_get_request ( "test-bucket" , "large.bin" , None ) ;
@@ -211,7 +211,7 @@ async fn concurrent_cache_access() {
211211 . await ;
212212
213213 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
214- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
214+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
215215
216216 for _ in 0 ..10 {
217217 let req = build_get_request ( "test-bucket" , "concurrent.txt" , None ) ;
@@ -236,7 +236,7 @@ async fn different_buckets_separate_cache() {
236236 . await ;
237237
238238 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
239- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
239+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
240240
241241 // Fetch from both buckets
242242 let req = build_get_request ( "bucket-a" , "key.txt" , None ) ;
@@ -270,7 +270,7 @@ async fn cache_byte_size_eviction() {
270270
271271 // Cache with max_size of 2000 bytes (room for ~4 objects of 500 bytes)
272272 let cache = create_test_cache ( 100 , 2000 , 300 ) ;
273- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
273+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
274274
275275 // Fetch all 10 objects
276276 for i in 0 ..10 {
@@ -306,7 +306,7 @@ async fn backend_error_not_cached() {
306306 // Don't add the object — backend will return NoSuchKey
307307
308308 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
309- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
309+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
310310
311311 // Request non-existent object
312312 let req = build_get_request ( "test-bucket" , "missing.txt" , None ) ;
@@ -333,7 +333,7 @@ async fn max_cacheable_size_rejects_large_objects() {
333333
334334 // Proxy with max_cacheable_size = 1000 (rejects objects > 1KB)
335335 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
336- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , 1000 , false ) ;
336+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , 1000 , false ) ;
337337
338338 // Small object: should be cached
339339 let req = build_get_request ( "test-bucket" , "small.bin" , None ) ;
@@ -363,7 +363,7 @@ async fn cache_hit_preserves_metadata() {
363363 . await ;
364364
365365 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
366- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
366+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
367367
368368 // First request: cache miss
369369 let req = build_get_request ( "test-bucket" , "meta.txt" , None ) ;
@@ -392,7 +392,7 @@ async fn head_object_does_not_populate_cache() {
392392 . await ;
393393
394394 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
395- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
395+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
396396
397397 // HEAD request — should be delegated, not cached
398398 let req = s3s:: S3Request {
@@ -425,7 +425,7 @@ async fn put_then_get_sees_new_content() {
425425 . await ;
426426
427427 let cache = create_test_cache ( 100 , usize:: MAX , 300 ) ;
428- let proxy = CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
428+ let proxy = S3CachingProxy :: new ( backend. clone ( ) , Some ( cache. clone ( ) ) , usize:: MAX , false ) ;
429429
430430 // GET: caches "version1"
431431 let req = build_get_request ( "test-bucket" , "mutable.txt" , None ) ;
0 commit comments