77import test .helm .Helm ;
88import test .model .Product ;
99
10+ import java .util .List ;
1011import java .util .Map ;
1112
1213class JiraS3EnabledTest {
@@ -17,38 +18,43 @@ void initHelm(TestInfo testInfo) {
1718 helm = new Helm (testInfo );
1819 }
1920
21+ private static final List <String > STORAGE_TYPES = List .of ("avatars" , "attachments" , "backups" );
2022
2123 @ ParameterizedTest
2224 @ EnumSource (value = Product .class , names = {"jira" })
23- void jira_s3_avatars_storage_env_vars (Product product ) throws Exception {
24- final var resources = helm .captureKubeResourcesFromHelmChart (product , Map .of (
25- product + ".s3Storage.avatars.bucketName" , "my-bucket" ,
26- product + ".s3Storage.avatars.bucketRegion" , "my-region"
27- ));
25+ void s3_storage_env_vars (Product product ) throws Exception {
26+ for (String storageType : STORAGE_TYPES ) {
27+ final var resources = helm .captureKubeResourcesFromHelmChart (product , Map .of (
28+ product + ".s3Storage." + storageType + ".bucketName" , "my-bucket" ,
29+ product + ".s3Storage." + storageType + ".bucketRegion" , "my-region"
30+ ));
2831
29- resources .getStatefulSet (product .getHelmReleaseName ())
30- .getContainer ()
31- .getEnv ()
32- .assertHasValue ("ATL_S3AVATARS_BUCKET_NAME" , "my-bucket" )
33- .assertHasValue ("ATL_S3AVATARS_REGION" , "my-region" )
34- .assertDoesNotHaveAnyOf ("ATL_S3AVATARS_ENDPOINT_OVERRIDE" );
32+ resources .getStatefulSet (product .getHelmReleaseName ())
33+ .getContainer ()
34+ .getEnv ()
35+ .assertHasValue ("ATL_S3" + storageType .toUpperCase () + "_BUCKET_NAME" , "my-bucket" )
36+ .assertHasValue ("ATL_S3" + storageType .toUpperCase () + "_REGION" , "my-region" )
37+ .assertDoesNotHaveAnyOf ("ATL_S3" + storageType .toUpperCase () + "_ENDPOINT_OVERRIDE" );
38+ }
3539 }
3640
3741 @ ParameterizedTest
3842 @ EnumSource (value = Product .class , names = {"jira" })
39- void jira_s3_avatars_storage_endpoint_override (Product product ) throws Exception {
40- final var resources = helm .captureKubeResourcesFromHelmChart (product , Map .of (
41- product + ".s3Storage.avatars.bucketName" , "my-bucket" ,
42- product + ".s3Storage.avatars.bucketRegion" , "my-region" ,
43- product + ".s3Storage.avatars.endpointOverride" , "http://minio.svc.cluster.local"
44- ));
43+ void s3_storage_endpoint_override (Product product ) throws Exception {
44+ for (String storageType : STORAGE_TYPES ) {
45+ final var resources = helm .captureKubeResourcesFromHelmChart (product , Map .of (
46+ product + ".s3Storage." + storageType + ".bucketName" , "my-bucket" ,
47+ product + ".s3Storage." + storageType + ".bucketRegion" , "my-region" ,
48+ product + ".s3Storage." + storageType + ".endpointOverride" , "http://minio.svc.cluster.local"
49+ ));
4550
46- resources .getStatefulSet (product .getHelmReleaseName ())
47- .getContainer ()
48- .getEnv ()
49- .assertHasValue ("ATL_S3AVATARS_BUCKET_NAME" , "my-bucket" )
50- .assertHasValue ("ATL_S3AVATARS_REGION" , "my-region" )
51- .assertHasValue ("ATL_S3AVATARS_ENDPOINT_OVERRIDE" , "http://minio.svc.cluster.local" );
51+ resources .getStatefulSet (product .getHelmReleaseName ())
52+ .getContainer ()
53+ .getEnv ()
54+ .assertHasValue ("ATL_S3" + storageType .toUpperCase () + "_BUCKET_NAME" , "my-bucket" )
55+ .assertHasValue ("ATL_S3" + storageType .toUpperCase () + "_REGION" , "my-region" )
56+ .assertHasValue ("ATL_S3" + storageType .toUpperCase () + "_ENDPOINT_OVERRIDE" , "http://minio.svc.cluster.local" );
57+ }
5258 }
5359
5460 @ ParameterizedTest
0 commit comments