/src/test/java/com/alibaba/json/bvt/bug/Bug_for_km.java

https://github.com/alibaba/fastjson · Java · 129 lines · 67 code · 17 blank · 45 comment · 0 complexity · 3152be6c48a746f456291d288747e42e MD5 · raw file

  1. package com.alibaba.json.bvt.bug;
  2. import com.alibaba.fastjson.JSON;
  3. import junit.framework.TestCase;
  4. import java.util.concurrent.TimeUnit;
  5. public class Bug_for_km
  6. extends TestCase {
  7. public void test_for_issue() throws Exception {
  8. String str = "{\n" +
  9. "\t\"bizSubmitInfos\": [{\n" +
  10. "\t\t\"bizType\": \"ISSUE\",\n" +
  11. "\t\t\"privacyInfo\": \"{\\\"bcAnchorMid\\\":\\\"101CITI000000001000\\\",\\\"bcMid\\\":\\\"102BABA000000000001\\\",\\\"bcSubmitMid\\\":\\\"102BABA000000000001\\\",\\\"bizId\\\":\\\"transfer_autoTest_pri_weiweitestt_8857136636875877184\\\",\\\"bizType\\\":\\\"ISSUE\\\",\\\"currency\\\":\\\"USD\\\",\\\"exchangeRate\\\":{\\\"encryptedExchangeRate\\\":\\\"123\\\",\\\"envelopeKeyInfos\\\":{}},\\\"pcAmount\\\":{\\\"envelopeKeyInfos\\\":{},\\\"proof\\\":\\\"proff\\\"}}\",\n" +
  12. "\t\t\"submitInfoList\": [{\n" +
  13. "\t\t\t\"checkPrivacyResult\": {\n" +
  14. "\t\t\t\t\"checkResult\": \"{\\\"checkResultStatus\\\":\\\"ACCEPT\\\",\\\"hashOfPrivacyPreservingInfo\\\":\\\"NfYRZwG/Yki8LU01vsyWINGaXv94+gYoPBFVMFEKyTM=\\\",\\\"memberId\\\":\\\"101CITI000000001000\\\"}\",\n" +
  15. "\t\t\t\t\"signature\": \"testing_signature\"\n" +
  16. "\t\t\t},\n" +
  17. "\t\t\t\"pid\": \"101CITI000000001000\"\n" +
  18. "\t\t}]\n" +
  19. "\t}],\n" +
  20. "\t\"resultInfo\": {\n" +
  21. "\t\t\"resultCode\": \"SUCCESS\",\n" +
  22. "\t\t\"resultCodeId\": \"00000000\",\n" +
  23. "\t\t\"resultMsg\": \"success\",\n" +
  24. "\t\t\"resultStatus\": \"S\"\n" +
  25. "\t}\n" +
  26. "}";
  27. WhaleGeneratePrivacyResponseBody resp = JSON.parseObject(str, WhaleGeneratePrivacyResponseBody.class);
  28. System.out.println(resp.resultInfo.resultStatus);
  29. // System.out.println(str);
  30. }
  31. public static class WhaleGeneratePrivacyResponseBody {
  32. public ResultInfo resultInfo;
  33. }
  34. /**
  35. * @author freud.wy
  36. * @version $Id: ResultInfo.java, v 0.1 2019-05-28 上午11:02 freud.wy Exp $$
  37. */
  38. public static class ResultInfo {
  39. private String resultStatus;
  40. private String resultCodeId;
  41. private String resultCode;
  42. private String resultMsg;
  43. /**
  44. * Getter method for property <tt>resultStatus</tt>.
  45. *
  46. * @return property value of resultStatus
  47. */
  48. public String getResultStatus() {
  49. return resultStatus;
  50. }
  51. /**
  52. * Setter method for property <tt>resultStatus</tt>.
  53. *
  54. * @param resultStatus value to be assigned to property resultStatus
  55. */
  56. public void setResultStatus(String resultStatus) {
  57. this.resultStatus = resultStatus;
  58. }
  59. /**
  60. * Getter method for property <tt>resultCodeId</tt>.
  61. *
  62. * @return property value of resultCodeId
  63. */
  64. public String getResultCodeId() {
  65. return resultCodeId;
  66. }
  67. /**
  68. * Setter method for property <tt>resultCodeId</tt>.
  69. *
  70. * @param resultCodeId value to be assigned to property resultCodeId
  71. */
  72. public void setResultCodeId(String resultCodeId) {
  73. this.resultCodeId = resultCodeId;
  74. }
  75. /**
  76. * Getter method for property <tt>resultCode</tt>.
  77. *
  78. * @return property value of resultCode
  79. */
  80. public String getResultCode() {
  81. return resultCode;
  82. }
  83. /**
  84. * Setter method for property <tt>resultCode</tt>.
  85. *
  86. * @param resultCode value to be assigned to property resultCode
  87. */
  88. public void setResultCode(String resultCode) {
  89. this.resultCode = resultCode;
  90. }
  91. /**
  92. * Getter method for property <tt>resultMsg</tt>.
  93. *
  94. * @return property value of resultMsg
  95. */
  96. public String getResultMsg() {
  97. return resultMsg;
  98. }
  99. /**
  100. * Setter method for property <tt>resultMsg</tt>.
  101. *
  102. * @param resultMsg value to be assigned to property resultMsg
  103. */
  104. public void setResultMsg(String resultMsg) {
  105. this.resultMsg = resultMsg;
  106. }
  107. @Override
  108. public String toString() {
  109. return String.format("resultStatus[%s],resultCodeId[%s],resultCode[%s],resultMsg[%s]",resultStatus,resultCodeId,resultCode,resultMsg);
  110. }
  111. }
  112. }