This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from sbtqa/fix-jsonCleaner
Refactor json cleaner from regex to parser
- Loading branch information
Showing
6 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
plugins/rest-plugin/src/test/java/ru/sbtqa/tag/api/entries/template/EmptyArraysEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package ru.sbtqa.tag.api.entries.template; | ||
|
||
import ru.sbtqa.tag.api.EndpointEntry; | ||
import ru.sbtqa.tag.api.annotation.Body; | ||
import ru.sbtqa.tag.api.annotation.Validation; | ||
import ru.sbtqa.tag.pagefactory.Rest; | ||
import ru.sbtqa.tag.pagefactory.annotations.rest.Endpoint; | ||
|
||
import static org.hamcrest.Matchers.equalTo; | ||
|
||
@Endpoint(method = Rest.POST, path = "client/arrays-as-is", title = "empty arrays", template = "templates/EmptyArrays.json", shouldRemoveEmptyObjects = true) | ||
public class EmptyArraysEntry extends EndpointEntry { | ||
|
||
@Body(name = "first") | ||
private String first; | ||
|
||
@Validation(title = "result") | ||
public void validate() { | ||
String expected = "[ \"1\" , \"2\" , { \"milk\" : true , \"first\" : \"parameter\"}]"; | ||
getResponse().body("result", equalTo(expected)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
plugins/rest-plugin/src/test/resources/templates/EmptyArrays.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
"1", | ||
"2", | ||
{}, | ||
[{},{}], | ||
|
||
{ | ||
"id": null, | ||
"user": "", | ||
"milk": true, | ||
"first": "${first}" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters