I want to use Rest Assured to work with Azure DevOps. All was smooth until it came to creating testcases. I am able to create it with hardcoded strings. This is not as useful because I'll need to port the strings as POJO objects for reusability. I tried this on Postman, and it works perfectly. I have tried to, first of all, change the XML string to JSON but always get the error of unformatted HTML.
This is the payload in Postman
{
"op": "add",
"path": "/fields/Microsoft.VSTS.TCM.Steps",
"value": "<steps id=\"0\" last=\"1\"><step id=\"2\" type=\"ValidateStep\"><parameterizedString isformatted=\"true\">Input step 1</parameterizedString><parameterizedString isformatted=\"true\">Expectation step 1</parameterizedString><description/></step><step id=\"2\" type=\"ValidateStep\"><parameterizedString isformatted=\"true\">Input step 1</parameterizedString><parameterizedString isformatted=\"true\">Expectation step 1</parameterizedString><description/></step><step id=\"2\" type=\"ValidateStep\"><parameterizedString isformatted=\"true\">Input step 1</parameterizedString><parameterizedString isformatted=\"true\">Expectation step 1</parameterizedString><description/></step></steps>"
}
How do I port this to JSON? I mean the values of the value attribute.
This is the ported version to JSON to be used in Postman.
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "new addition step apps new definition"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.TCM.Steps",
"value": {
"id": "0",
"last": "1",
"steps": [
{
"id": "2",
"type": "ValidateStep",
"parameterizedString": [
{
"isformatted": "true",
"value": "Input step 1"
},
{
"isformatted": "true",
"value": "Expectation step 1"
}
],
"description": ""
},
{
"id": "2",
"type": "ValidateStep",
"parameterizedString": [
{
"isformatted": "true",
"value": "Input step 1"
},
{
"isformatted": "true",
"value": "Expectation step 1"
}
],
"description": ""
},
{
"id": "2",
"type": "ValidateStep",
"parameterizedString": [
{
"isformatted": "true",
"value": "Input step 1"
},
{
"isformatted": "true",
"value": "Expectation step 1"
}
],
"description": ""
}
]
}
}
]
When the ported JSON is run in Postman, it returns this error. But if I use the String format above, it works perfectly. I'll need to port the values of the value parameter to JSON so that I can create POJO classes from them.