获取错误JUNIT json字符串中无法识别的字符转义'S'

时间:2019-08-20 06:10:05

标签: java json

com.fasterxml.jackson.databind.JsonMappingException: Unrecognized character escape 's' (code 83)
com.fasterxml.jackson.databind.JsonMappingException: Unrecognized character escape 'S' (code 83)

获取// s // S的错误的方法

我尝试//// s设置了小s,但随后却出现了大写S的错误。

String uiConfigs1 = "[{\"resourceId\":\"IRCA\",\"resourceClassification\":\"CUACCI\",\"compSeq\":1,\"compName\":\"QuickFilterComponent\",\"fieldSeq\":1,\"rowSeq\":1,\"fieldType\":\"dropdown\",\"uiFieldName\":\"accFilterCriteria\",\"value\":\"F01#F02#F03#F04#F05\",\"active\":\"Y\",\"fieldDependency\":\"\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"CUACCI\",\"compSeq\":1,\"compName\":\"QuickFilterComponent\",\"fieldSeq\":2,\"rowSeq\":1,\"fieldType\":\"dropdown\",\"uiFieldName\":\"accInstFilterCriteria\",\"value\":\"Response#CUACCI\",\"active\":\"Y\",\"fieldDependency\":\"accFilterCriteria#F01#F02#F03\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"CUACCI\",\"compSeq\":1,\"compName\":\"QuickFilterComponent\",\"fieldSeq\":3,\"rowSeq\":1,\"fieldType\":\"text\",\"uiFieldName\":\"filteraccountTitle\",\"value\":\"Regx#[\\s\\S]*\",\"active\":\"Y\",\"fieldDependency\":\"accFilterCriteria#F03\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"CUACCI\",\"compSeq\":1,\"compName\":\"QuickFilterComponent\",\"fieldSeq\":3,\"rowSeq\":1,\"fieldType\":\"text\",\"uiFieldName\":\"filteraccountNumber\",\"value\":\"Regx#^([0-9]|([0-9][0-9-/]{0,33}[0-9]))$\",\"active\":\"Y\",\"fieldDependency\":\"accFilterCriteria#F01\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"IRCAAL\",\"compSeq\":2,\"compName\":\"SectionTableComponent\",\"fieldSeq\":1,\"rowSeq\":0,\"fieldType\":\"label\",\"uiFieldName\":\"CheckBoxData#accNumber\",\"value\":\"frmtAccountNumber\",\"active\":\"Y\",\"fieldDependency\":\"\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"IRCAAL\",\"compSeq\":2,\"compName\":\"SectionTableComponent\",\"fieldSeq\":1,\"rowSeq\":0,\"fieldType\":\"CheckBoxHeading\",\"uiFieldName\":\"chkBoxHeadingSelCol\",\"value\":\"\",\"active\":\"Y\",\"fieldDependency\":\"\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"IRCAAL\",\"compSeq\":2,\"compName\":\"SectionTableComponent\",\"fieldSeq\":1,\"rowSeq\":0,\"fieldType\":\"ColumnHeading\",\"uiFieldName\":\"colHeadingAccTitleNumber\",\"value\":\"\",\"active\":\"Y\",\"fieldDependency\":\"\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"IRCAAL\",\"compSeq\":2,\"compName\":\"SectionTableComponent\",\"fieldSeq\":1,\"rowSeq\":0,\"fieldType\":\"label\",\"uiFieldName\":\"CheckBoxData#accTitle\",\"value\":\"accountNLSTitle\",\"active\":\"Y\",\"fieldDependency\":\"\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"IRCAAL\",\"compSeq\":2,\"compName\":\"SectionTableComponent\",\"fieldSeq\":2,\"rowSeq\":0,\"fieldType\":\"CheckBoxHeading\",\"uiFieldName\":\"ALWD\",\"value\":\"\",\"active\":\"Y\",\"fieldDependency\":\"\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"IRCAAL\",\"compSeq\":2,\"compName\":\"SectionTableComponent\",\"fieldSeq\":2,\"rowSeq\":0,\"fieldType\":\"ColumnHeading\",\"uiFieldName\":\"colHeadingAlwd\",\"value\":\"\",\"active\":\"Y\",\"fieldDependency\":\"\"},{\"resourceId\":\"IRCA\",\"resourceClassification\":\"IRCAAL\",\"compSeq\":2,\"compName\":\"SectionTableComponent\",\"fieldSeq\":2,\"rowSeq\":0,\"fieldType\":\"checkbox\",\"uiFieldName\":\"CheckBoxData#ALWD\",\"value\":\"authCodeY\",\"active\":\"Y\",\"fieldDependency\":\"\"}]";

虽然运行junit测试用例成功,但是如上所述却给了我错误

1 个答案:

答案 0 :(得分:0)

我使用//// s //// S

解决了这个转义问题