I am trying to validate the json response. Have gone through the documentation in wiremock and also tried github example as below syntax.
https://github.com/tomakehurst/wiremock/blob/master/src/test/java/ignored/Examples.java#374
@Test
public void toDoListScenario() {
stubFor(get(urlEqualTo("/todo/items")).inScenario("To do list")
.whenScenarioStateIs(STARTED)
.willReturn(aResponse()
.withBody("<items>" +
" <item>Buy milk</item>" +
"</items>"))); }
How to enter the json response in Body Section.
{
employeeDetails : [
employeeName : ABCDE,
employeeID : 12345 ]
}
Is the below representation is correct. Please help me on this.
.withBody("employeeDetails:" +
"employeeID" : "12345" +
"employeeName" : "Preethi" + )