Skip to content

Commit b3d2ded

Browse files
committed
Add update to services
1 parent 051fa49 commit b3d2ded

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'io.securecodebox'
8-
version '0.0.3-SNAPSHOT'
8+
version '0.0.4-SNAPSHOT'
99
sourceCompatibility = '11'
1010

1111
repositories {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,12 @@ public void delete(long id) {
154154

155155
restTemplate.exchange(defectDojoUrl + "/api/v2/" + getUrlPath() + "/" + id + "/", HttpMethod.DELETE, payload, String.class);
156156
}
157+
158+
public T update(T object, long objectId) {
159+
RestTemplate restTemplate = new RestTemplate();
160+
HttpEntity<T> payload = new HttpEntity<T>(object, getDefectDojoAuthorizationHeaders());
161+
162+
ResponseEntity<T> response = restTemplate.exchange(defectDojoUrl + "/api/v2/" + getUrlPath() + "/" + objectId + "/", HttpMethod.PUT, payload, getModelClass());
163+
return response.getBody();
164+
}
157165
}

0 commit comments

Comments
 (0)