File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
tests/NetDevPack.Security.Jwt.Tests/Warmups Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,16 @@ public class WarmupFileStore : IWarmupTest
12
12
{
13
13
private readonly IJsonWebKeyStore _jsonWebKeyStore ;
14
14
public ServiceProvider Services { get ; set ; }
15
+ public DirectoryInfo _directoryInfo ;
16
+
15
17
public WarmupFileStore ( )
16
18
{
19
+ _directoryInfo = TempDirectoryTest ( ) ;
20
+
17
21
var serviceCollection = new ServiceCollection ( ) ;
18
22
serviceCollection . AddLogging ( ) ;
19
23
serviceCollection . AddMemoryCache ( ) ;
20
- serviceCollection . AddJwksManager ( ) . PersistKeysToFileSystem ( TempDirectoryTest ( ) ) ;
24
+ serviceCollection . AddJwksManager ( ) . PersistKeysToFileSystem ( _directoryInfo ) ;
21
25
Services = serviceCollection . BuildServiceProvider ( ) ;
22
26
_jsonWebKeyStore = Services . GetRequiredService < IJsonWebKeyStore > ( ) ;
23
27
}
@@ -32,6 +36,8 @@ public DirectoryInfo TempDirectoryTest()
32
36
public async Task Clear ( )
33
37
{
34
38
await _jsonWebKeyStore . Clear ( ) ;
39
+ _directoryInfo . Delete ( true ) ;
40
+ Directory . CreateDirectory ( _directoryInfo . FullName ) ;
35
41
}
36
42
}
37
43
}
You can’t perform that action at this time.
0 commit comments