From f8245f033e6142e895218d4b4ec4b898713a4c7e Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Thu, 18 Jan 2024 15:16:47 +0100 Subject: [PATCH 1/2] Rename class --- src/main/java/com/adyen/controller/WebhookController.java | 8 ++++---- .../util/{EventHandler.java => AfpEventHandler.java} | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/main/java/com/adyen/util/{EventHandler.java => AfpEventHandler.java} (96%) diff --git a/src/main/java/com/adyen/controller/WebhookController.java b/src/main/java/com/adyen/controller/WebhookController.java index b5d7093..b70029a 100644 --- a/src/main/java/com/adyen/controller/WebhookController.java +++ b/src/main/java/com/adyen/controller/WebhookController.java @@ -6,7 +6,7 @@ import com.adyen.model.configurationwebhooks.BalanceAccountNotificationRequest; import com.adyen.model.configurationwebhooks.PaymentNotificationRequest; import com.adyen.notification.BankingWebhookHandler; -import com.adyen.util.EventHandler; +import com.adyen.util.AfpEventHandler; import com.adyen.util.HMACValidator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,11 +56,11 @@ public ResponseEntity webhooks(@RequestHeader Map header // } // Deserialise json payload - EventHandler eventHandler = new EventHandler(); + AfpEventHandler afpEventHandler = new AfpEventHandler(); BankingWebhookHandler webhookHandler = new BankingWebhookHandler(json); - String type = eventHandler.getEventType(json); - String environment = eventHandler.getEventEnvironment(json); + String type = afpEventHandler.getEventType(json); + String environment = afpEventHandler.getEventEnvironment(json); log.info("Event " + type + " on " + environment); diff --git a/src/main/java/com/adyen/util/EventHandler.java b/src/main/java/com/adyen/util/AfpEventHandler.java similarity index 96% rename from src/main/java/com/adyen/util/EventHandler.java rename to src/main/java/com/adyen/util/AfpEventHandler.java index 968bb90..27672b4 100644 --- a/src/main/java/com/adyen/util/EventHandler.java +++ b/src/main/java/com/adyen/util/AfpEventHandler.java @@ -9,7 +9,7 @@ * Helper class to process AfP events */ @Service -public class EventHandler { +public class AfpEventHandler { public String getEventType(String json) throws JsonProcessingException { ObjectMapper objectMapper = new ObjectMapper(); From a6a412d31ec2437dc5b106b62b1ac887e3276b5e Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Thu, 18 Jan 2024 15:16:59 +0100 Subject: [PATCH 2/2] Clean before running --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 39e9891..ee44e8c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,7 +3,7 @@ tasks: before: | sdk install java 17.0.4.1-tem < /dev/null command: | - ./mvnw spring-boot:run + ./mvnw clean spring-boot:run echo Backend running - name: frontend