Skip to content

Commit 191729f

Browse files
committed
test case and sms.properties chages.
1 parent 56f841c commit 191729f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

NMSReportingSuite/src/main/resources/sms.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
senderid=nmsfoobar
2-
endpoint=http://stagesmsapi.nationalmhealth.in/smsmessaging/v1/outbound/nmssenderid/requests-dummy
1+
senderid=HEALTH
2+
endpoint=https://smsapi.nationalmhealth.in/smsmessaging/v1/outbound/requests.php
33
callbackEndpoint=https://kma.mohfw.gov.in/NMSReportingSuite/nms/deliveryNotification
44

55
sms.authentication.key=don'tsaythemagicword

NMSReportingSuite/src/test/java/com/beehyv/nmsreporting/business/impl/SmsServiceImplTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.nio.charset.Charset;
2828
import java.nio.charset.StandardCharsets;
2929

30+
import static com.beehyv.nmsreporting.utils.Global.getProperty;
3031
import static org.junit.Assert.*;
3132
import static org.mockito.Mockito.*;
3233

@@ -57,11 +58,11 @@ public void setup(){
5758
PowerMockito.mockStatic(FileUtils.class);
5859

5960
PowerMockito.mockStatic(HttpClientBuilder.class);
60-
61+
PowerMockito.when(Global.getProperty("sms.otp.templateId.default")).thenReturn("1007689146828763356");
6162
PowerMockito.when(Global.getProperty("sms.templateId.default")).thenReturn("1007163065348946395");
6263
PowerMockito.when(Global.getProperty("sms.entityId.default")).thenReturn("1301159100860122510");
6364
PowerMockito.when(Global.getProperty("sms.telemarketerId.default")).thenReturn("1001096933494158");
64-
PowerMockito.when(Global.getProperty("senderid")).thenReturn("nmsfoobar");
65+
PowerMockito.when(Global.getProperty("senderid")).thenReturn("HEALTH");
6566
PowerMockito.when(Global.getProperty("sms.authentication.key")).thenReturn("don'tsaythemagicword");
6667
PowerMockito.when(Global.getProperty("endpoint")).thenReturn("http://stagesmsapi.nationalmhealth.in/smsmessaging/v1/outbound/nmssenderid/requests-dummy");
6768

@@ -183,10 +184,10 @@ public void testBuildOTPSMS_ValidInput() throws Exception {
183184
// Validate the populated template
184185
assertNotNull(result);
185186
assertTrue(result.contains("tel: 1234567890"));
186-
assertTrue(result.contains("tel: nmsfoobar"));
187+
assertTrue(result.contains("tel: HEALTH"));
187188
assertTrue(result.contains("Test OTP Message"));
188189
assertTrue(result.contains("https://kma.mohfw.gov.in/NMSReportingSuite/nms/deliveryNotification/otp"));
189-
assertTrue(result.contains("1007163065348946395"));
190+
assertTrue(result.contains("1007689146828763356"));
190191
assertTrue(result.contains("1301159100860122510"));
191192
assertTrue(result.contains("1001096933494158"));
192193
}
@@ -299,7 +300,7 @@ public void testBuildCertificateSMS_ValidInput() throws Exception {
299300
assertNotNull(result);
300301
assertTrue(result.contains(String.valueOf(phoneNumber)));
301302
assertTrue(result.contains(messageContent));
302-
assertTrue(result.contains("tel: nmsfoobar"));
303+
assertTrue(result.contains("tel: HEALTH"));
303304
assertTrue(result.contains("Congratulations on completing the course!"));
304305
assertTrue(result.contains("1"));
305306
assertTrue(result.contains("1007163065348946395"));

0 commit comments

Comments
 (0)