File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
src/main/java/io/securecodebox/persistence/defectdojo/service Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -119,19 +119,22 @@ public String getFilename() {
119119 body .add ("file" , contentsAsResource );
120120
121121 final var payload = new HttpEntity <MultiValueMap <String , Object >>(body , headers );
122-
123- final var restTemplate = this .createRestTemplate ();
124- return restTemplate .exchange (
125- generateApiUrl (endpoint ),
126- HttpMethod .POST ,
127- payload ,
128- ImportScanResponse .class )
129- .getBody ();
122+ return exchangeRequest (endpoint , payload );
130123 } catch (HttpClientErrorException e ) {
131124 throw new DefectDojoPersistenceException ("Failed to attach findings to engagement." );
132125 }
133126 }
134127
128+ ImportScanResponse exchangeRequest (String endpoint , HttpEntity <?> payload ) {
129+ final var restTemplate = this .createRestTemplate ();
130+ return restTemplate .exchange (
131+ generateApiUrl (endpoint ),
132+ HttpMethod .POST ,
133+ payload ,
134+ ImportScanResponse .class )
135+ .getBody ();
136+ }
137+
135138 String generateApiUrl (final String endpoint ) {
136139 return String .format ("%s/api/v2/%s/" , getDefectDojoUrl (), endpoint );
137140 }
You can’t perform that action at this time.
0 commit comments