Skip to content

Json file contains ":" in content would get JsonSyntaxException #340

@MoonLikeSinging

Description

@MoonLikeSinging

QAF Version

2.1.14

Steps To Reproduce

1.  Use above test data in feature as test file

Expected behavior

I can get the content in test successfully.

Actual behavior

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 67 path $.[2]

Is the issue reproducible on runner?

  • QAS
  • Maven
  • Gradle
  • Ant
  • Eclipse

Test case sample

###Test Data
[
{
"waitTimeToReceiveEmail": "5",
"emailContent" : {
"sender" : "test@test.com",
"title": "test",
"content" : ["休假申请已被批准", "业务流程:短期休假申请:moon"]
}
}
]

Feature file

Then User can validate email content with "<emailContent>"
Examples: {'datafile':'./src/main/resources/data/test.json'}

Note:

I use Gson to get the content, it's worked well.
JsonParser.parseReader(new FileReader("test.json"))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions