Updates of the NBI
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / clients / AsyncRestClient.java
index 2e6df94..45c7afa 100644 (file)
@@ -19,7 +19,6 @@
  */
 package org.oransc.policyagent.clients;
 
-import org.oransc.policyagent.exceptions.AsyncRestClientException;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.web.reactive.function.client.WebClient;
@@ -28,6 +27,15 @@ import reactor.core.publisher.Mono;
 public class AsyncRestClient {
     private final WebClient client;
 
+    private static class AsyncRestClientException extends Exception {
+
+        private static final long serialVersionUID = 1L;
+
+        public AsyncRestClientException(String message) {
+            super(message);
+        }
+    }
+
     public AsyncRestClient(String baseUrl) {
         this.client = WebClient.create(baseUrl);
     }
@@ -52,12 +60,12 @@ public class AsyncRestClient {
             .bodyToMono(String.class);
     }
 
-    public Mono<Void> delete(String uri) {
+    public Mono<String> delete(String uri) {
         return client.delete() //
             .uri(uri) //
             .retrieve() //
             .onStatus(HttpStatus::isError,
                 response -> Mono.error(new AsyncRestClientException(response.statusCode().toString()))) //
-            .bodyToMono(Void.class);
+            .bodyToMono(String.class);
     }
 }