8383@ ClearSystemProperty (key = "TRUSTIFY_DA_DEV_MODE" )
8484@ ClearSystemProperty (key = "TRUSTIFY_DA_PROXY_URL" )
8585@ ClearSystemProperty (key = "DEV_TRUSTIFY_DA_BACKEND_URL" )
86- @ ClearSystemProperty (key = "RHDA_TOKEN " )
87- @ ClearSystemProperty (key = "RHDA_SOURCE " )
86+ @ ClearSystemProperty (key = "TRUST_DA_TOKEN " )
87+ @ ClearSystemProperty (key = "TRUST_DA_SOURCE " )
8888@ SuppressWarnings ("unchecked" )
8989class TRUSTIFY_DA_Api_Test extends ExhortTest {
9090
@@ -101,8 +101,8 @@ void cleanup() {
101101
102102 @ Test
103103 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
104- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
105- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
104+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
105+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
106106 void stackAnalysisHtml_with_pom_xml_should_return_html_report_from_the_backend ()
107107 throws IOException , ExecutionException , InterruptedException {
108108 // create a temporary pom.xml file
@@ -124,9 +124,15 @@ void stackAnalysisHtml_with_pom_xml_should_return_html_report_from_the_backend()
124124 &&
125125 // snyk token is set using the environment variable (annotation)
126126 r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
127- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
128- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
129- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Stack Analysis" )
127+ && r .headers ()
128+ .firstValue ("trust-da-token" )
129+ .get ()
130+ .equals ("trust-da-token-from-env-var" )
131+ && r .headers ()
132+ .firstValue ("trust-da-source" )
133+ .get ()
134+ .equals ("trust-da-source-from-env-var" )
135+ && r .headers ().firstValue ("trust-da-operation-type" ).get ().equals ("Stack Analysis" )
130136 && r .method ().equals ("POST" );
131137
132138 // load dummy html and set as the expected analysis
@@ -162,8 +168,8 @@ void stackAnalysisHtml_with_pom_xml_should_return_html_report_from_the_backend()
162168
163169 @ Test
164170 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token" )
165- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token" )
166- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source" )
171+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token" )
172+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source" )
167173 void stackAnalysis_with_pom_xml_should_return_json_object_from_the_backend ()
168174 throws IOException , ExecutionException , InterruptedException {
169175 // create a temporary pom.xml file
@@ -183,9 +189,9 @@ void stackAnalysis_with_pom_xml_should_return_json_object_from_the_backend()
183189 r .headers ().firstValue ("Content-Type" ).get ().equals ("fake-content-type" )
184190 && r .headers ().firstValue ("Accept" ).get ().equals ("application/json" )
185191 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token" )
186- && r .headers ().firstValue ("rhda- token" ).get ().equals ("rhda -token" )
187- && r .headers ().firstValue ("rhda- source" ).get ().equals ("rhda -source" )
188- && r .headers ().firstValue ("rhda -operation-type" ).get ().equals ("Stack Analysis" )
192+ && r .headers ().firstValue ("trust-da- token" ).get ().equals ("trust-da -token" )
193+ && r .headers ().firstValue ("trust-da- source" ).get ().equals ("trust-da -source" )
194+ && r .headers ().firstValue ("trust-da -operation-type" ).get ().equals ("Stack Analysis" )
189195 && r .method ().equals ("POST" );
190196
191197 // load dummy json and set as the expected analysis
@@ -238,8 +244,8 @@ void componentAnalysis_with_pom_xml_should_return_json_object_from_the_backend()
238244
239245 // we expect this to picked up because no env var to take precedence
240246 System .setProperty ("TRUSTIFY_DA_SNYK_TOKEN" , "snyk-token-from-property" );
241- System .setProperty ("RHDA_TOKEN " , "rhda -token-from-property" );
242- System .setProperty ("RHDA_SOURCE " , "rhda -source-from-property" );
247+ System .setProperty ("TRUST_DA_TOKEN " , "trust-da -token-from-property" );
248+ System .setProperty ("TRUST_DA_SOURCE " , "trust-da -source-from-property" );
243249
244250 // create an argument matcher to make sure we mock the response for the right request
245251 ArgumentMatcher <HttpRequest > matchesRequest =
@@ -250,9 +256,18 @@ void componentAnalysis_with_pom_xml_should_return_json_object_from_the_backend()
250256 // snyk token is set using properties which is picked up because no env var
251257 // specified
252258 r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-property" )
253- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-property" )
254- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-property" )
255- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Component Analysis" )
259+ && r .headers ()
260+ .firstValue ("trust-da-token" )
261+ .get ()
262+ .equals ("trust-da-token-from-property" )
263+ && r .headers ()
264+ .firstValue ("trust-da-source" )
265+ .get ()
266+ .equals ("trust-da-source-from-property" )
267+ && r .headers ()
268+ .firstValue ("trust-da-operation-type" )
269+ .get ()
270+ .equals ("Component Analysis" )
256271 && r .method ().equals ("POST" );
257272
258273 // load dummy json and set as the expected analysis
@@ -457,8 +472,8 @@ void check_TRUSTIFY_DA_Url_When_Nothing_Set_Then_Default_TRUSTIFY_DA_URL_Selecte
457472
458473 @ Test
459474 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
460- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
461- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
475+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
476+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
462477 @ SetSystemProperty (key = SKIP_VALIDATION_KEY , value = "true" )
463478 void test_image_analysis ()
464479 throws IOException , ExecutionException , InterruptedException , MalformedPackageURLException {
@@ -521,9 +536,18 @@ void test_image_analysis()
521536 .get ()
522537 .equals (Api .MediaType .APPLICATION_JSON .toString ())
523538 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
524- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
525- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
526- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Image Analysis" )
539+ && r .headers ()
540+ .firstValue ("trust-da-token" )
541+ .get ()
542+ .equals ("trust-da-token-from-env-var" )
543+ && r .headers ()
544+ .firstValue ("trust-da-source" )
545+ .get ()
546+ .equals ("trust-da-source-from-env-var" )
547+ && r .headers ()
548+ .firstValue ("trust-da-operation-type" )
549+ .get ()
550+ .equals ("Image Analysis" )
527551 && r .method ().equals ("POST" );
528552
529553 when (mockHttpClient .sendAsync (argThat (matchesRequest ), any ()))
@@ -557,8 +581,8 @@ void test_image_analysis()
557581
558582 @ Test
559583 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
560- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
561- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
584+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
585+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
562586 @ SetSystemProperty (key = SKIP_VALIDATION_KEY , value = "true" )
563587 void imageAnalysisHtml () throws IOException , ExecutionException , InterruptedException {
564588 try (MockedStatic <Operations > mock = Mockito .mockStatic (Operations .class );
@@ -620,9 +644,18 @@ void imageAnalysisHtml() throws IOException, ExecutionException, InterruptedExce
620644 .get ()
621645 .equals (Api .MediaType .TEXT_HTML .toString ())
622646 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
623- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
624- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
625- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Image Analysis" )
647+ && r .headers ()
648+ .firstValue ("trust-da-token" )
649+ .get ()
650+ .equals ("trust-da-token-from-env-var" )
651+ && r .headers ()
652+ .firstValue ("trust-da-source" )
653+ .get ()
654+ .equals ("trust-da-source-from-env-var" )
655+ && r .headers ()
656+ .firstValue ("trust-da-operation-type" )
657+ .get ()
658+ .equals ("Image Analysis" )
626659 && r .method ().equals ("POST" );
627660
628661 when (mockHttpClient .sendAsync (argThat (matchesRequest ), any ()))
@@ -635,8 +668,8 @@ void imageAnalysisHtml() throws IOException, ExecutionException, InterruptedExce
635668
636669 @ Test
637670 @ SetSystemProperty (key = "TRUSTIFY_DA_SNYK_TOKEN" , value = "snyk-token-from-env-var" )
638- @ SetSystemProperty (key = "RHDA_TOKEN " , value = "rhda -token-from-env-var" )
639- @ SetSystemProperty (key = "RHDA_SOURCE " , value = "rhda -source-from-env-var" )
671+ @ SetSystemProperty (key = "TRUST_DA_TOKEN " , value = "trust-da -token-from-env-var" )
672+ @ SetSystemProperty (key = "TRUST_DA_SOURCE " , value = "trust-da -source-from-env-var" )
640673 void test_perform_batch_analysis ()
641674 throws IOException , MalformedPackageURLException , ExecutionException , InterruptedException {
642675 try (var is = getResourceAsStreamDecision (this .getClass (), "msc/image/image_sbom.json" )) {
@@ -658,9 +691,18 @@ void test_perform_batch_analysis()
658691 .get ()
659692 .equals (Api .MediaType .APPLICATION_JSON .toString ())
660693 && r .headers ().firstValue ("ex-snyk-token" ).get ().equals ("snyk-token-from-env-var" )
661- && r .headers ().firstValue ("rhda-token" ).get ().equals ("rhda-token-from-env-var" )
662- && r .headers ().firstValue ("rhda-source" ).get ().equals ("rhda-source-from-env-var" )
663- && r .headers ().firstValue ("rhda-operation-type" ).get ().equals ("Image Analysis" )
694+ && r .headers ()
695+ .firstValue ("trust-da-token" )
696+ .get ()
697+ .equals ("trust-da-token-from-env-var" )
698+ && r .headers ()
699+ .firstValue ("trust-da-source" )
700+ .get ()
701+ .equals ("trust-da-source-from-env-var" )
702+ && r .headers ()
703+ .firstValue ("trust-da-operation-type" )
704+ .get ()
705+ .equals ("Image Analysis" )
664706 && r .method ().equals ("POST" );
665707
666708 var imageRef =
0 commit comments