|
27 | 27 | import java.nio.charset.Charset; |
28 | 28 | import java.nio.charset.StandardCharsets; |
29 | 29 |
|
| 30 | +import static com.beehyv.nmsreporting.utils.Global.getProperty; |
30 | 31 | import static org.junit.Assert.*; |
31 | 32 | import static org.mockito.Mockito.*; |
32 | 33 |
|
@@ -57,11 +58,11 @@ public void setup(){ |
57 | 58 | PowerMockito.mockStatic(FileUtils.class); |
58 | 59 |
|
59 | 60 | PowerMockito.mockStatic(HttpClientBuilder.class); |
60 | | - |
| 61 | + PowerMockito.when(Global.getProperty("sms.otp.templateId.default")).thenReturn("1007689146828763356"); |
61 | 62 | PowerMockito.when(Global.getProperty("sms.templateId.default")).thenReturn("1007163065348946395"); |
62 | 63 | PowerMockito.when(Global.getProperty("sms.entityId.default")).thenReturn("1301159100860122510"); |
63 | 64 | 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"); |
65 | 66 | PowerMockito.when(Global.getProperty("sms.authentication.key")).thenReturn("don'tsaythemagicword"); |
66 | 67 | PowerMockito.when(Global.getProperty("endpoint")).thenReturn("http://stagesmsapi.nationalmhealth.in/smsmessaging/v1/outbound/nmssenderid/requests-dummy"); |
67 | 68 |
|
@@ -183,10 +184,10 @@ public void testBuildOTPSMS_ValidInput() throws Exception { |
183 | 184 | // Validate the populated template |
184 | 185 | assertNotNull(result); |
185 | 186 | assertTrue(result.contains("tel: 1234567890")); |
186 | | - assertTrue(result.contains("tel: nmsfoobar")); |
| 187 | + assertTrue(result.contains("tel: HEALTH")); |
187 | 188 | assertTrue(result.contains("Test OTP Message")); |
188 | 189 | assertTrue(result.contains("https://kma.mohfw.gov.in/NMSReportingSuite/nms/deliveryNotification/otp")); |
189 | | - assertTrue(result.contains("1007163065348946395")); |
| 190 | + assertTrue(result.contains("1007689146828763356")); |
190 | 191 | assertTrue(result.contains("1301159100860122510")); |
191 | 192 | assertTrue(result.contains("1001096933494158")); |
192 | 193 | } |
@@ -299,7 +300,7 @@ public void testBuildCertificateSMS_ValidInput() throws Exception { |
299 | 300 | assertNotNull(result); |
300 | 301 | assertTrue(result.contains(String.valueOf(phoneNumber))); |
301 | 302 | assertTrue(result.contains(messageContent)); |
302 | | - assertTrue(result.contains("tel: nmsfoobar")); |
| 303 | + assertTrue(result.contains("tel: HEALTH")); |
303 | 304 | assertTrue(result.contains("Congratulations on completing the course!")); |
304 | 305 | assertTrue(result.contains("1")); |
305 | 306 | assertTrue(result.contains("1007163065348946395")); |
|
0 commit comments