@@ -1859,9 +1859,14 @@ public async Task FetchDataSetDetails_Success()
1859
1859
. WithPublicApiDataSetVersion ( major : 1 , minor : 0 )
1860
1860
) ;
1861
1861
1862
+ var azuriteContainer = await GetAzuriteContainer ( ) ;
1863
+
1864
+ var configuration = CreateConfiguration ( ) ;
1865
+ configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
1866
+
1862
1867
var publicBlobStorageService = new PublicBlobStorageService (
1863
1868
logger : new Logger < BlobStorageService > ( new LoggerFactory ( ) ) ,
1864
- configuration : await CreateConfigurtionWithAzurite ( ) ) ;
1869
+ configuration : configuration ) ;
1865
1870
1866
1871
var formFile = CreateDataCsvFormFile ( """"
1867
1872
column_1,column_2,column_3
@@ -1984,9 +1989,14 @@ public async Task FetchCsvWithSingleDataRow_Success()
1984
1989
. WithFile ( _fixture . DefaultFile ( )
1985
1990
. WithDataSetFileMeta ( _fixture . DefaultDataSetFileMeta ( ) ) ) ;
1986
1991
1992
+ var azuriteContainer = await GetAzuriteContainer ( ) ;
1993
+
1994
+ var configuration = CreateConfiguration ( ) ;
1995
+ configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
1996
+
1987
1997
var publicBlobStorageService = new PublicBlobStorageService (
1988
1998
logger : new Logger < BlobStorageService > ( new LoggerFactory ( ) ) ,
1989
- configuration : await CreateConfigurtionWithAzurite ( ) ) ;
1999
+ configuration : configuration ) ;
1990
2000
1991
2001
var formFile = CreateDataCsvFormFile ( """
1992
2002
column_1,column_2,column_3
@@ -2052,9 +2062,14 @@ public async Task FetchDataSetFiltersOrdered_Success()
2052
2062
new FilterMeta { Id = filter2Id , Label = "Filter 2" , ColumnName = "filter_2" , } ,
2053
2063
] ) ) ) ;
2054
2064
2065
+ var azuriteContainer = await GetAzuriteContainer ( ) ;
2066
+
2067
+ var configuration = CreateConfiguration ( ) ;
2068
+ configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
2069
+
2055
2070
var publicBlobStorageService = new PublicBlobStorageService (
2056
2071
logger : new Logger < BlobStorageService > ( new LoggerFactory ( ) ) ,
2057
- configuration : await CreateConfigurtionWithAzurite ( ) ) ;
2072
+ configuration : configuration ) ;
2058
2073
2059
2074
var formFile = CreateDataCsvFormFile ( """
2060
2075
column_1
@@ -2119,9 +2134,14 @@ public async Task FetchDataSetIndicatorsOrdered_Success()
2119
2134
new IndicatorMeta { Id = indicator4Id , Label = "Indicator 4" , ColumnName = "indicator_4" , } ,
2120
2135
] ) ) ) ;
2121
2136
2137
+ var azuriteContainer = await GetAzuriteContainer ( ) ;
2138
+
2139
+ var configuration = CreateConfiguration ( ) ;
2140
+ configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
2141
+
2122
2142
var publicBlobStorageService = new PublicBlobStorageService (
2123
2143
logger : new Logger < BlobStorageService > ( new LoggerFactory ( ) ) ,
2124
- configuration : await CreateConfigurtionWithAzurite ( ) ) ;
2144
+ configuration : configuration ) ;
2125
2145
2126
2146
var formFile = CreateDataCsvFormFile ( """
2127
2147
column_1
@@ -2179,9 +2199,14 @@ public async Task FetchVariables_Success()
2179
2199
new IndicatorMeta { Id = Guid . NewGuid ( ) , Label = "Indicator 4" , ColumnName = "F_indicator_4" , } ,
2180
2200
] ) ) ) ;
2181
2201
2202
+ var azuriteContainer = await GetAzuriteContainer ( ) ;
2203
+
2204
+ var configuration = CreateConfiguration ( ) ;
2205
+ configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
2206
+
2182
2207
var publicBlobStorageService = new PublicBlobStorageService (
2183
2208
logger : new Logger < BlobStorageService > ( new LoggerFactory ( ) ) ,
2184
- configuration : await CreateConfigurtionWithAzurite ( ) ) ;
2209
+ configuration : configuration ) ;
2185
2210
2186
2211
var formFile = CreateDataCsvFormFile ( """
2187
2212
column_1
@@ -2259,9 +2284,14 @@ public async Task FetchDataSetFootnotes_Success()
2259
2284
. WithFilters ( new List < Filter > { filter } ) )
2260
2285
. Generate ( ) ;
2261
2286
2262
- var publicBlobStorageService = new PublicBlobStorageService (
2287
+ var azuriteContainer = await GetAzuriteContainer ( ) ;
2288
+
2289
+ var configuration = CreateConfiguration ( ) ;
2290
+ configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
2291
+
2292
+ var publicBlobStorageService = new PublicBlobStorageService (
2263
2293
logger : new Logger < BlobStorageService > ( new LoggerFactory ( ) ) ,
2264
- configuration : await CreateConfigurtionWithAzurite ( ) ) ;
2294
+ configuration : configuration ) ;
2265
2295
2266
2296
var formFile = CreateDataCsvFormFile ( """
2267
2297
column_1
@@ -2378,9 +2408,14 @@ public async Task AmendmentNotPublished_ReturnsOk()
2378
2408
. WithReleaseVersion ( publication . ReleaseVersions [ 2 ] ) // the draft version
2379
2409
. WithFile ( file ) ;
2380
2410
2411
+ var azuriteContainer = await GetAzuriteContainer ( ) ;
2412
+
2413
+ var configuration = CreateConfiguration ( ) ;
2414
+ configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
2415
+
2381
2416
var publicBlobStorageService = new PublicBlobStorageService (
2382
2417
logger : new Logger < BlobStorageService > ( new LoggerFactory ( ) ) ,
2383
- configuration : await CreateConfigurtionWithAzurite ( ) ) ;
2418
+ configuration : configuration ) ;
2384
2419
2385
2420
var formFile = CreateDataCsvFormFile ( """
2386
2421
column_1
@@ -2476,20 +2511,23 @@ private WebApplicationFactory<TestStartup> BuildApp(
2476
2511
} ) ;
2477
2512
}
2478
2513
2479
- private async Task < IConfiguration > CreateConfigurtionWithAzurite ( )
2514
+ private async Task < AzuriteContainer > GetAzuriteContainer ( )
2480
2515
{
2481
2516
var azuriteContainer = new AzuriteBuilder ( )
2482
2517
. WithImage ( "mcr.microsoft.com/azure-storage/azurite:3.27.0" )
2483
2518
. WithHostname ( "data-storage-test" )
2484
2519
. Build ( ) ;
2485
2520
await azuriteContainer . StartAsync ( ) ;
2521
+ return azuriteContainer ;
2522
+ }
2486
2523
2524
+ private IConfiguration CreateConfiguration ( )
2525
+ {
2487
2526
var configuration = new ConfigurationBuilder ( )
2488
2527
. SetBasePath ( Directory . GetCurrentDirectory ( ) )
2489
2528
. AddJsonFile ( "appsettings.IntegrationTest.json" , optional : false )
2490
2529
. AddEnvironmentVariables ( )
2491
2530
. Build ( ) ;
2492
- configuration [ "PublicStorage" ] = azuriteContainer . GetConnectionString ( ) ;
2493
2531
2494
2532
return configuration ;
2495
2533
}
0 commit comments