@@ -11,7 +11,6 @@ defmodule RabbitMQMessageDeduplication.CacheManager.Test do
11
11
alias :timer , as: Timer
12
12
alias :mnesia , as: Mnesia
13
13
alias RabbitMQMessageDeduplication.Cache , as: Cache
14
- alias RabbitMQMessageDeduplication.Common , as: Common
15
14
alias RabbitMQMessageDeduplication.CacheManager , as: CacheManager
16
15
17
16
setup do
@@ -27,17 +26,17 @@ defmodule RabbitMQMessageDeduplication.CacheManager.Test do
27
26
options = [ persistence: :memory ]
28
27
29
28
CacheManager . create ( :cache , true , options )
30
- { :atomic , [ :cache ] } = Mnesia . transaction ( fn -> Mnesia . all_keys ( Common . caches ( ) ) end )
29
+ { :atomic , [ :cache ] } = Mnesia . transaction ( fn -> Mnesia . all_keys ( caches ( ) ) end )
31
30
CacheManager . destroy ( :cache )
32
31
end
33
32
34
33
test "cache deletion" , % { } do
35
34
options = [ persistence: :memory ]
36
35
37
36
:ok = CacheManager . create ( :cache , false , options )
38
- { :atomic , [ :cache ] } = Mnesia . transaction ( fn -> Mnesia . all_keys ( Common . caches ( ) ) end )
37
+ { :atomic , [ :cache ] } = Mnesia . transaction ( fn -> Mnesia . all_keys ( caches ( ) ) end )
39
38
:ok = CacheManager . destroy ( :cache )
40
- { :atomic , [ ] } = Mnesia . transaction ( fn -> Mnesia . all_keys ( Common . caches ( ) ) end )
39
+ { :atomic , [ ] } = Mnesia . transaction ( fn -> Mnesia . all_keys ( caches ( ) ) end )
41
40
end
42
41
43
42
test "cache cleanup routine" , % { } do
@@ -54,4 +53,6 @@ defmodule RabbitMQMessageDeduplication.CacheManager.Test do
54
53
55
54
:ok = CacheManager . destroy ( :cache )
56
55
end
56
+
57
+ def caches ( ) , do: :message_deduplication_caches
57
58
end
0 commit comments