Skip to content

Commit

Permalink
Merge pull request #1733 from nandhu-kumar/develop
Browse files Browse the repository at this point in the history
MOSIP-38542 - Fix OTP and Report Width Size Mismatch Issue
  • Loading branch information
mohanachandran-s authored Feb 20, 2025
2 parents 30f9df7 + e593d40 commit 832149b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,15 @@ protected Response postWithBodyAndCookie(String url, String jsonInput, boolean a
response = RestClient.postRequestWithCookie(url, inputJson, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_JSON, cookieName, token);
}

GlobalMethods.reportResponse(response.getHeaders().asList().toString(), url, response);

if (auditLogCheck) {
JSONObject jsonObject = new JSONObject(inputJson);
String timeStamp1 = jsonObject.getString(GlobalConstants.REQUESTTIME);
String dbChecker = GlobalConstants.TEST_FULLNAME + BaseTestCase.getLanguageList().get(0);
checkDbAndValidate(timeStamp1, dbChecker);
}
GlobalMethods.reportResponse(response.getHeaders().asList().toString(), url, response);

} catch (Exception e) {
logger.error(GlobalConstants.EXCEPTION_STRING_2 + e);
Expand Down Expand Up @@ -5584,8 +5585,10 @@ public static String smtpOtpHandler(String inputJson, String testCaseName) {
|| request.getString("otp").endsWith(GlobalConstants.MOSIP_IO)
|| request.getString("otp").endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = request.get("otp").toString();
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE))
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, "");
emailId = removeLeadingPlusSigns(emailId);
}
logger.info(emailId);
otp = OTPListener.getOtp(emailId);
request.put("otp", otp);
Expand Down Expand Up @@ -5623,8 +5626,10 @@ public static String smtpOtpHandler(String inputJson, String testCaseName) {
|| request.getJSONObject(GlobalConstants.REQUEST).getString("otp")
.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = request.getJSONObject(GlobalConstants.REQUEST).get("otp").toString();
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE))
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, "");
emailId = removeLeadingPlusSigns(emailId);
}
logger.info(emailId);
otp = OTPListener.getOtp(emailId);
request.getJSONObject(GlobalConstants.REQUEST).put("otp", otp);
Expand All @@ -5648,8 +5653,10 @@ public static String smtpOtpHandler(String inputJson, String testCaseName) {
|| request.getJSONObject(GlobalConstants.REQUEST).getString("otp")
.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = request.getJSONObject(GlobalConstants.REQUEST).get("otp").toString();
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE))
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, "");
emailId = removeLeadingPlusSigns(emailId);
}
logger.info(emailId);
otp = OTPListener.getOtp(emailId);
request.getJSONObject(GlobalConstants.REQUEST).put("otp", otp);
Expand Down Expand Up @@ -5678,8 +5685,10 @@ public static String smtpOtpHandler(String inputJson, String testCaseName) {
emailId = request.getJSONObject(GlobalConstants.REQUEST)
.getJSONArray(GlobalConstants.CHALLENGELIST).getJSONObject(0)
.getString(GlobalConstants.CHALLENGE);
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE))
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, "");
emailId = removeLeadingPlusSigns(emailId);
}
logger.info(emailId);
otp = OTPListener.getOtp(emailId);
request.getJSONObject(GlobalConstants.REQUEST)
Expand All @@ -5705,8 +5714,10 @@ public static String smtpOtpHandler(String inputJson, String testCaseName) {
|| request.getJSONObject(GlobalConstants.REQUEST).getString("otp")
.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = request.getJSONObject(GlobalConstants.REQUEST).get("otp").toString();
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE))
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, "");
emailId = removeLeadingPlusSigns(emailId);
}
logger.info(emailId);
otp = OTPListener.getOtp(emailId);
request.getJSONObject(GlobalConstants.REQUEST).put("otp", otp);
Expand All @@ -5730,8 +5741,10 @@ public static String smtpOtpHandler(String inputJson, String testCaseName) {
emailId = request.getJSONObject(GlobalConstants.REQUEST)
.getJSONArray(GlobalConstants.CHALLENGELIST).getJSONObject(0)
.getString(GlobalConstants.CHALLENGE);
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE))
if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) {
emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, "");
emailId = removeLeadingPlusSigns(emailId);
}
logger.info(emailId);
otp = OTPListener.getOtp(emailId);
request.getJSONObject(GlobalConstants.REQUEST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ public static String getOutputValidationReport(Map<String, List<OutputValidation
*/
public static String getTextAreaJsonMsgHtml(String content) {
StringBuilder sb = new StringBuilder();
sb.append("<div> <textarea style='border:solid 1px black;' name='message' rows='6' cols='160' readonly='true'>");
// sb.append("<div> <textarea style='border:solid 1px black;' name='message' rows='6' cols='160' readonly='true'>");
sb.append("<div style='width: 100%; overflow: hidden;'>");
sb.append("<textarea style='border:solid 1px black; width: 100%; box-sizing: border-box;' name='message' rows='6' readonly='true'>");
try {
sb.append(JsonPrecondtion.toPrettyFormat(content));
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ servicesNotDeployed=
esignetMockBaseURL=esignet-insurance.
sunBirdBaseURL=registry
slack-webhook-url=
serverErrorsToMonitor=IDA-MLC-018
serverErrorsToMonitor=
pmsAuthInternal=true
partner_password=mosip123
partner_userName=111997
Expand Down

0 comments on commit 832149b

Please sign in to comment.