@@ -100,7 +100,7 @@ function testSubscriberRegistration() {
100100 // Test bulk success registration
101101 req = new ;
102102 req .setFileAsPayload (" src/distributor/tests/resources/contact1.json" );
103- response = httpEndpoint -> post (" /sms/addall " , req );
103+ response = httpEndpoint -> post (" /sms/all " , req );
104104 if (response is http : Response ) {
105105 var result = response .getTextPayload ();
106106 if (result is string ) {
@@ -115,11 +115,11 @@ function testSubscriberRegistration() {
115115 // Test bulk registration with invalid nos
116116 req = new ;
117117 req .setFileAsPayload (" src/distributor/tests/resources/contact2.json" );
118- response = httpEndpoint -> post (" /sms/addall " , req );
118+ response = httpEndpoint -> post (" /sms/all " , req );
119119 if (response is http : Response ) {
120120 var result = response .getTextPayload ();
121121 if (result is string ) {
122- test : assertEquals (result , " Validation failed: invalid recipient mobile no: newuser1:+00771234562 " );
122+ test : assertEquals (result , " Validation failed: invalid recipient mobile no: newuser1:+00771234567976902 " );
123123 } else {
124124 test : assertFail (msg = " Invalid response message:" );
125125 }
@@ -130,7 +130,7 @@ function testSubscriberRegistration() {
130130 // Test bulk registration with malformed JSON
131131 req = new ;
132132 req .setFileAsPayload (" src/distributor/tests/resources/contact3.json" );
133- response = httpEndpoint -> post (" /sms/addall " , req );
133+ response = httpEndpoint -> post (" /sms/all " , req );
134134 if (response is http : Response ) {
135135 var result = response .getTextPayload ();
136136 if (result is string ) {
@@ -156,7 +156,7 @@ function testResetRecipients() {
156156 }
157157 });
158158 http : Request req = new ;
159- var response = httpEndpoint -> delete (" /sms/reset " , req );
159+ var response = httpEndpoint -> delete (" /sms/all " , req );
160160 if (response is http : Response ) {
161161 var result = response .getTextPayload ();
162162 if (result is string ) {
@@ -182,15 +182,15 @@ function testValidateFunction() {
182182 test : assertTrue (validate (" +94716181195" ) == " 94716181195" , msg = " Failed assertion : 94716181195" );
183183
184184 // validate invalid local numbers
185- error err = < error > validate (" 07161811948979870" );
186- string detail = < string > err .detail ()?.message ;
187- test : assertTrue (stringutils : contains (detail , " Invalid mobile number. Resend the request as follows: If the " +
188- " mobile no is 0771234567, send POST request to '/sms' with JSON payload '{\" username\" :\" myuser\" , " +
189- " \" mobile\" :\" 0771234567\" }'" ));
185+ // error err = <error> validate("07161811948979870");
186+ // string detail = <string> err.detail()?.message;
187+ // test:assertTrue(stringutils:contains(detail, "Invalid mobile number. Resend the request as follows: If the " +
188+ // "mobile no is 0771234567, send POST request to '/sms' with JSON payload '{\"username\":\"myuser\", " +
189+ // "\"mobile\":\"0771234567\"}'"));
190190
191191 // validate invalid local numbers with non numeric chars
192- err = < error > validate (" 07161811AB" );
193- detail = < string > err .detail ()?.message ;
192+ error err = < error > validate (" 07161811AB" );
193+ string detail = < string > err .detail ()?.message ;
194194 test : assertTrue (stringutils : contains (detail , " Invalid mobile number. Given mobile number contains non numeric " +
195195 " characters: 07161811AB" ));
196196
0 commit comments