Package com.skava.marketplace.util
Class EventValidationUtil
java.lang.Object
com.skava.marketplace.util.EventValidationUtil
This utility class is used for validating webhook events.
-
Constructor Summary
ConstructorsConstructorDescriptionEventValidationUtil
(JsonReaderResourceUtil jsonReaderResourceUtil) Constructor for EventValidationUtil. -
Method Summary
Modifier and TypeMethodDescriptionvalidateWebhooksEvent
(List<WebhooksConfig> webhooksConfigList) Validates the events in the provided list of WebhooksConfig objects.
-
Constructor Details
-
EventValidationUtil
Constructor for EventValidationUtil.- Parameters:
jsonReaderResourceUtil
- utility for reading JSON resources
-
-
Method Details
-
validateWebhooksEvent
Validates the events in the provided list of WebhooksConfig objects. It reads a JSON file to get a map of valid events and their priorities. Then, it checks if each event in the WebhooksConfig objects is present in the map. If an event is not found in the map, it returns true, indicating that the configuration contains an invalid event. If all events are found in the map, it returns false.- Parameters:
webhooksConfigList
- list of WebhooksConfig objects to validate- Returns:
- true if an invalid event is found, false otherwise
- Throws:
IOException
- if there is an error reading the JSON file
-