From a3ac2b7f381f597fd81dd05b63953053ac3cd97f Mon Sep 17 00:00:00 2001 From: komakkar <komakkar@microsoft.com> Date: Thu, 3 Sep 2020 12:31:15 +0530 Subject: [PATCH] Resolving comments --- .../provider/azure/models/HandshakeRequestData.java | 3 ++- .../provider/azure/models/NotificationData.java | 7 ++----- .../provider/azure/models/NotificationRequest.java | 3 ++- .../azure/pubsub/EventGridRequestBodyExtractor.java | 4 ++-- .../notification/provider/azure/util/AppProperties.java | 2 -- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/HandshakeRequestData.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/HandshakeRequestData.java index 36f38f0b1..d1b7489ec 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/HandshakeRequestData.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/HandshakeRequestData.java @@ -14,13 +14,14 @@ package org.opengroup.osdu.notification.provider.azure.models; +import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class HandshakeRequestData { private String validationCode; diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationData.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationData.java index 1895248fa..45437a5e3 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationData.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationData.java @@ -15,6 +15,7 @@ package org.opengroup.osdu.notification.provider.azure.models; +import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -22,8 +23,8 @@ import lombok.NoArgsConstructor; import java.util.Map; @Data -@NoArgsConstructor @AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class NotificationData { private String data; @@ -31,9 +32,5 @@ public class NotificationData { private Map<String,String> attributes; private String messageId; - - String validationCode; - - String validationUrl; } diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationRequest.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationRequest.java index 636c92028..32236c6e2 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationRequest.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/models/NotificationRequest.java @@ -15,13 +15,14 @@ package org.opengroup.osdu.notification.provider.azure.models; import com.google.gson.JsonObject; +import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class NotificationRequest { private String id; diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java index d81b4ea0e..0d1a40336 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java @@ -32,7 +32,6 @@ import org.springframework.web.context.annotation.RequestScope; import javax.servlet.http.HttpServletRequest; import java.io.BufferedReader; -import java.io.IOException; import java.util.Base64; import java.util.Map; import java.util.stream.Collectors; @@ -59,7 +58,8 @@ public class EventGridRequestBodyExtractor implements IPubsubRequestBodyExtracto private HandshakeRequestData handshakeRequestData; private boolean isHandshakeRequest; - public EventGridRequestBodyExtractor(@Autowired HttpServletRequest httpServletRequest, @Autowired JaxRsDpsLog log) { + @Autowired + public EventGridRequestBodyExtractor(HttpServletRequest httpServletRequest, JaxRsDpsLog log) { this.httpServletRequest = httpServletRequest; this.log = log; this.notificationRequest = extractNotificationRequestFromHttpRequest(); diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AppProperties.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AppProperties.java index 8d751e083..59736e877 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AppProperties.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AppProperties.java @@ -15,10 +15,8 @@ package org.opengroup.osdu.notification.provider.azure.util; -import com.azure.cosmos.CosmosClient; import com.azure.security.keyvault.secrets.SecretClient; import com.azure.security.keyvault.secrets.models.KeyVaultSecret; -import org.opengroup.osdu.azure.KeyVaultFacade; import org.opengroup.osdu.notification.provider.interfaces.IAppProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -- GitLab