Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DedunuKarunarathne committed Sep 12, 2023
1 parent 8083836 commit 13d1b16
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.wso2.openbanking.accelerator.event.notifications.service.util;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;

/**
* Test class for EventNotificationServiceUtil.
*/
public class EventNotificationServiceUtilTests {
@Test
public void testGetCustomNotificationPayload() throws Exception {
JsonNode jsonNode = new ObjectMapper().readTree("{\"key\": \"value\"}");
String payload = EventNotificationServiceUtil.getCustomNotificationPayload(jsonNode);
assertNotNull(payload);
assertEquals("{\"key\":\"value\"}", payload);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<class name="com.wso2.openbanking.accelerator.event.notifications.service.service.EventPollingServiceTests"></class>
<class name="com.wso2.openbanking.accelerator.event.notifications.service.service.EventCreationServiceTests"></class>
<class name="com.wso2.openbanking.accelerator.event.notifications.service.service.EventSubscriptionServiceTests"></class>
<class name="com.wso2.openbanking.accelerator.event.notifications.service.util.EventNotificationServiceUtilTests"></class>
<class name="com.wso2.openbanking.accelerator.event.notifications.service.realtime.service.EventNotificationProducerServiceTests"></class>
<class name="com.wso2.openbanking.accelerator.event.notifications.service.realtime.service.RealtimeEventNotificationLoaderServiceTest"></class>
<class name="com.wso2.openbanking.accelerator.event.notifications.service.realtime.service.RealtimeEventNotificationSenderServiceTests"></class>
Expand Down

0 comments on commit 13d1b16

Please sign in to comment.