Skip to content

Commit 779478f

Browse files
committed
Debul log requested URL to know what URI path to mock in tests
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent ab4584b commit 779478f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/io/securecodebox/persistence/defectdojo/service/GenericDefectDojoService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.securecodebox.persistence.defectdojo.model.Model;
1919
import io.securecodebox.persistence.defectdojo.model.PaginatedResult;
2020
import lombok.Getter;
21+
import lombok.extern.slf4j.Slf4j;
2122
import org.springframework.http.HttpEntity;
2223
import org.springframework.http.HttpHeaders;
2324
import org.springframework.http.HttpMethod;
@@ -36,6 +37,7 @@
3637

3738
// FIXME: Should be package private bc implementation detail.
3839
// TODO: Remove JsonProcessingException, URISyntaxException from public API and use a own runtime exception type bc these checked exceptions clutter the client coe.
40+
@Slf4j
3941
public abstract class GenericDefectDojoService<T extends Model> {
4042
private static final String API_PREFIX = "/api/v2/";
4143
private static final long DEFECT_DOJO_OBJET_LIMIT = 100L;
@@ -94,8 +96,10 @@ public T get(long id) {
9496
var restTemplate = this.getRestTemplate();
9597
HttpEntity<String> payload = new HttpEntity<>(getDefectDojoAuthorizationHeaders());
9698

99+
final var url = this.config.getUrl() + API_PREFIX + this.getUrlPath() + "/" + id;
100+
log.debug("Requesting URL: {}", url);
97101
ResponseEntity<T> response = restTemplate.exchange(
98-
this.config.getUrl() + API_PREFIX + this.getUrlPath() + "/" + id,
102+
url,
99103
HttpMethod.GET,
100104
payload,
101105
getModelClass()
@@ -119,6 +123,7 @@ protected PaginatedResult<T> internalSearch(Map<String, Object> queryParams, lon
119123
}
120124

121125
var url = new URI(this.config.getUrl() + API_PREFIX + this.getUrlPath() + "/");
126+
log.debug("Requesting URL: " + url);
122127
var uriBuilder = UriComponentsBuilder.fromUri(url).queryParams(multiValueMap);
123128

124129
ResponseEntity<String> responseString = restTemplate.exchange(

0 commit comments

Comments
 (0)