Fix Sonar complains
[oam/nf-oam-adopter.git] / ves-nf-oam-adopter / ves-nf-oam-adopter-event-notifier / src / main / java / org / o / ran / oam / nf / oam / adopter / event / notifier / NotificationProvider.java
index 2814706..02980a4 100644 (file)
@@ -25,7 +25,6 @@ import com.google.gson.Gson;
 import io.reactivex.rxjava3.core.Completable;
 import io.reactivex.rxjava3.core.Single;
 import java.util.List;
-import org.apache.hc.client5.http.async.methods.SimpleHttpRequest;
 import org.apache.hc.client5.http.async.methods.SimpleHttpRequests;
 import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
 import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
@@ -78,7 +77,7 @@ public final class NotificationProvider implements VesEventNotifier {
     }
 
     private Completable notify(final String url, final String payload) {
-        final SimpleHttpRequest request = SimpleHttpRequests.post(url);
+        final var request = SimpleHttpRequests.post(url);
         request.setBody(payload, ContentType.APPLICATION_JSON);
         request.setHeader(HttpHeaders.AUTHORIZATION, authHeader);
         return Single.fromFuture(httpClient.execute(request, null))
@@ -89,7 +88,7 @@ public final class NotificationProvider implements VesEventNotifier {
     }
 
     private static Completable validatePost(final SimpleHttpResponse response) {
-        final String statusLine = new StatusLine(response).toString();
+        final var statusLine = new StatusLine(response).toString();
         final String entity;
         final int code = response.getCode();
         if (code == HttpStatus.SC_OK || code == HttpStatus.SC_ACCEPTED) {