Skip to content

Commit

Permalink
test case and sms.properties chages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mandar-Beehyv committed Dec 23, 2024
1 parent 56f841c commit 191729f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions NMSReportingSuite/src/main/resources/sms.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
senderid=nmsfoobar
endpoint=http://stagesmsapi.nationalmhealth.in/smsmessaging/v1/outbound/nmssenderid/requests-dummy
senderid=HEALTH
endpoint=https://smsapi.nationalmhealth.in/smsmessaging/v1/outbound/requests.php
callbackEndpoint=https://kma.mohfw.gov.in/NMSReportingSuite/nms/deliveryNotification

sms.authentication.key=don'tsaythemagicword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

import static com.beehyv.nmsreporting.utils.Global.getProperty;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

Expand Down Expand Up @@ -57,11 +58,11 @@ public void setup(){
PowerMockito.mockStatic(FileUtils.class);

PowerMockito.mockStatic(HttpClientBuilder.class);

PowerMockito.when(Global.getProperty("sms.otp.templateId.default")).thenReturn("1007689146828763356");
PowerMockito.when(Global.getProperty("sms.templateId.default")).thenReturn("1007163065348946395");
PowerMockito.when(Global.getProperty("sms.entityId.default")).thenReturn("1301159100860122510");
PowerMockito.when(Global.getProperty("sms.telemarketerId.default")).thenReturn("1001096933494158");
PowerMockito.when(Global.getProperty("senderid")).thenReturn("nmsfoobar");
PowerMockito.when(Global.getProperty("senderid")).thenReturn("HEALTH");
PowerMockito.when(Global.getProperty("sms.authentication.key")).thenReturn("don'tsaythemagicword");
PowerMockito.when(Global.getProperty("endpoint")).thenReturn("http://stagesmsapi.nationalmhealth.in/smsmessaging/v1/outbound/nmssenderid/requests-dummy");

Expand Down Expand Up @@ -183,10 +184,10 @@ public void testBuildOTPSMS_ValidInput() throws Exception {
// Validate the populated template
assertNotNull(result);
assertTrue(result.contains("tel: 1234567890"));
assertTrue(result.contains("tel: nmsfoobar"));
assertTrue(result.contains("tel: HEALTH"));
assertTrue(result.contains("Test OTP Message"));
assertTrue(result.contains("https://kma.mohfw.gov.in/NMSReportingSuite/nms/deliveryNotification/otp"));
assertTrue(result.contains("1007163065348946395"));
assertTrue(result.contains("1007689146828763356"));
assertTrue(result.contains("1301159100860122510"));
assertTrue(result.contains("1001096933494158"));
}
Expand Down Expand Up @@ -299,7 +300,7 @@ public void testBuildCertificateSMS_ValidInput() throws Exception {
assertNotNull(result);
assertTrue(result.contains(String.valueOf(phoneNumber)));
assertTrue(result.contains(messageContent));
assertTrue(result.contains("tel: nmsfoobar"));
assertTrue(result.contains("tel: HEALTH"));
assertTrue(result.contains("Congratulations on completing the course!"));
assertTrue(result.contains("1"));
assertTrue(result.contains("1007163065348946395"));
Expand Down

0 comments on commit 191729f

Please sign in to comment.