8484@ ClearSystemProperty (key = "TRUSTIFY_DA_DEV_MODE" )
8585@ ClearSystemProperty (key = "TRUSTIFY_DA_PROXY_URL" )
8686@ ClearSystemProperty (key = "DEV_TRUSTIFY_DA_BACKEND_URL" )
87- @ ClearSystemProperty (key = "RHDA_TOKEN " )
88- @ ClearSystemProperty (key = "RHDA_SOURCE " )
87+ @ ClearSystemProperty (key = "TRUST_DA_TOKEN " )
88+ @ ClearSystemProperty (key = "TRUST_DA_SOURCE " )
8989@ SuppressWarnings ("unchecked" )
9090class TRUSTIFY_DA_Api_Test extends ExhortTest {
9191
@@ -102,8 +102,8 @@ void cleanup() {
102102
103103 @ Test
104104 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
105- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
106- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
105+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
106+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
107107 void stackAnalysisHtml_with_pom_xml_should_return_html_report_from_the_backend ()
108108 throws IOException , ExecutionException , InterruptedException {
109109 // create a temporary pom.xml file
@@ -125,9 +125,15 @@ void stackAnalysisHtml_with_pom_xml_should_return_html_report_from_the_backend()
125125 &&
126126 // snyk token is set using the environment variable (annotation)
127127 r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
128- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
129- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
130- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Stack Analysis" )
128+ && r .headers ()
129+ .firstValue ("trust-da-token" )
130+ .get ()
131+ .equals ("trust-da-token-from-env-var" )
132+ && r .headers ()
133+ .firstValue ("trust-da-source" )
134+ .get ()
135+ .equals ("trust-da-source-from-env-var" )
136+ && r .headers ().firstValue ("trust-da-operation-type" ).get ().equals ("Stack Analysis" )
131137 && r .method ().equals ("POST" );
132138
133139 // load dummy html and set as the expected analysis
@@ -163,8 +169,8 @@ void stackAnalysisHtml_with_pom_xml_should_return_html_report_from_the_backend()
163169
164170 @ Test
165171 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token" )
166- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token" )
167- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source" )
172+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token" )
173+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source" )
168174 void stackAnalysis_with_pom_xml_should_return_json_object_from_the_backend ()
169175 throws IOException , ExecutionException , InterruptedException {
170176 // create a temporary pom.xml file
@@ -184,9 +190,9 @@ void stackAnalysis_with_pom_xml_should_return_json_object_from_the_backend()
184190 r .headers ().firstValue ("Content-Type" ).get ().equals ("fake-content-type" )
185191 && r .headers ().firstValue ("Accept" ).get ().equals ("application/json" )
186192 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token" )
187- && r .headers ().firstValue ("rhda- token" ).get ().equals ("rhda -token" )
188- && r .headers ().firstValue ("rhda- source" ).get ().equals ("rhda -source" )
189- && r .headers ().firstValue ("rhda -operation-type" ).get ().equals ("Stack Analysis" )
193+ && r .headers ().firstValue ("trust-da- token" ).get ().equals ("trust-da -token" )
194+ && r .headers ().firstValue ("trust-da- source" ).get ().equals ("trust-da -source" )
195+ && r .headers ().firstValue ("trust-da -operation-type" ).get ().equals ("Stack Analysis" )
190196 && r .method ().equals ("POST" );
191197
192198 // load dummy json and set as the expected analysis
@@ -239,8 +245,8 @@ void componentAnalysis_with_pom_xml_should_return_json_object_from_the_backend()
239245
240246 // we expect this to picked up because no env var to take precedence
241247 System .setProperty ("TRUSTIFY_DA_SNYK_TOKEN" , "snyk-token-from-property" );
242- System .setProperty ("RHDA_TOKEN " , "rhda -token-from-property" );
243- System .setProperty ("RHDA_SOURCE " , "rhda -source-from-property" );
248+ System .setProperty ("TRUST_DA_TOKEN " , "trust-da -token-from-property" );
249+ System .setProperty ("TRUST_DA_SOURCE " , "trust-da -source-from-property" );
244250
245251 // create an argument matcher to make sure we mock the response for the right request
246252 ArgumentMatcher <HttpRequest > matchesRequest =
@@ -251,9 +257,18 @@ void componentAnalysis_with_pom_xml_should_return_json_object_from_the_backend()
251257 // snyk token is set using properties which is picked up because no env var
252258 // specified
253259 r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-property" )
254- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-property" )
255- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-property" )
256- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Component Analysis" )
260+ && r .headers ()
261+ .firstValue ("trust-da-token" )
262+ .get ()
263+ .equals ("trust-da-token-from-property" )
264+ && r .headers ()
265+ .firstValue ("trust-da-source" )
266+ .get ()
267+ .equals ("trust-da-source-from-property" )
268+ && r .headers ()
269+ .firstValue ("trust-da-operation-type" )
270+ .get ()
271+ .equals ("Component Analysis" )
257272 && r .method ().equals ("POST" );
258273
259274 // load dummy json and set as the expected analysis
@@ -458,8 +473,8 @@ void check_TRUSTIFY_DA_Url_When_Nothing_Set_Then_Default_TRUSTIFY_DA_URL_Selecte
458473
459474 @ Test
460475 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
461- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
462- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
476+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
477+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
463478 @ SetSystemProperty (key = SKIP_VALIDATION_KEY , value = "true" )
464479 void test_image_analysis ()
465480 throws IOException , ExecutionException , InterruptedException , MalformedPackageURLException {
@@ -522,9 +537,18 @@ void test_image_analysis()
522537 .get ()
523538 .equals (Api .MediaType .APPLICATION_JSON .toString ())
524539 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
525- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
526- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
527- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Image Analysis" )
540+ && r .headers ()
541+ .firstValue ("trust-da-token" )
542+ .get ()
543+ .equals ("trust-da-token-from-env-var" )
544+ && r .headers ()
545+ .firstValue ("trust-da-source" )
546+ .get ()
547+ .equals ("trust-da-source-from-env-var" )
548+ && r .headers ()
549+ .firstValue ("trust-da-operation-type" )
550+ .get ()
551+ .equals ("Image Analysis" )
528552 && r .method ().equals ("POST" );
529553
530554 when (mockHttpClient .sendAsync (argThat (matchesRequest ), any ()))
@@ -558,8 +582,8 @@ void test_image_analysis()
558582
559583 @ Test
560584 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
561- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
562- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
585+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
586+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
563587 @ SetSystemProperty (key = SKIP_VALIDATION_KEY , value = "true" )
564588 void imageAnalysisHtml () throws IOException , ExecutionException , InterruptedException {
565589 try (MockedStatic <Operations > mock = Mockito .mockStatic (Operations .class );
@@ -621,9 +645,18 @@ void imageAnalysisHtml() throws IOException, ExecutionException, InterruptedExce
621645 .get ()
622646 .equals (Api .MediaType .TEXT_HTML .toString ())
623647 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
624- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
625- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
626- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Image Analysis" )
648+ && r .headers ()
649+ .firstValue ("trust-da-token" )
650+ .get ()
651+ .equals ("trust-da-token-from-env-var" )
652+ && r .headers ()
653+ .firstValue ("trust-da-source" )
654+ .get ()
655+ .equals ("trust-da-source-from-env-var" )
656+ && r .headers ()
657+ .firstValue ("trust-da-operation-type" )
658+ .get ()
659+ .equals ("Image Analysis" )
627660 && r .method ().equals ("POST" );
628661
629662 when (mockHttpClient .sendAsync (argThat (matchesRequest ), any ()))
@@ -636,8 +669,8 @@ void imageAnalysisHtml() throws IOException, ExecutionException, InterruptedExce
636669
637670 @ Test
638671 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
639- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
640- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
672+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
673+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
641674 void test_perform_batch_analysis ()
642675 throws IOException , MalformedPackageURLException , ExecutionException , InterruptedException {
643676 try (var is = getResourceAsStreamDecision (this .getClass (), "msc/image/image_sbom.json" )) {
@@ -659,9 +692,18 @@ void test_perform_batch_analysis()
659692 .get ()
660693 .equals (Api .MediaType .APPLICATION_JSON .toString ())
661694 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
662- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
663- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
664- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Image Analysis" )
695+ && r .headers ()
696+ .firstValue ("trust-da-token" )
697+ .get ()
698+ .equals ("trust-da-token-from-env-var" )
699+ && r .headers ()
700+ .firstValue ("trust-da-source" )
701+ .get ()
702+ .equals ("trust-da-source-from-env-var" )
703+ && r .headers ()
704+ .firstValue ("trust-da-operation-type" )
705+ .get ()
706+ .equals ("Image Analysis" )
665707 && r .method ().equals ("POST" );
666708
667709 var imageRef =
0 commit comments