Open BobCAE opened 2 years ago
What is the assertion supposed to check?
1
What type is expected? (e.g., JSONObject, JSONArray, String, Number, Boolean)
json array
Here is an overview of the current assertions:
Do you want to add another assertion?
no
Ok. Here is the generated test method code:
public void testCase() {
MiniClient c = new MiniClient(mainPath);
c.setConnectorEndpoint(connector.getHttpEndpoint());
try {
c.setLogin(AnonymousAgentImpl.IDENTIFIER, "");
ClientResponse result = c.sendRequest("POST", "/mensa/{id}", """
{}
""", "application/json", "*/*", new HashMap<>(), "null");
Assert.assertEquals(201, result.getHttpCode());
Object response = JSONValue.parse(result.getResponse().trim());
// Response body has type JSON Array
assertThat(response, isA(JSONArray.class));
} catch (Exception e) {
e.printStackTrace();
fail("Exception: " + e);
}
}
Request method
POST
Request Path
/mensa/{id}
Request Body
Expected Status Code
201 (Created)
Response Body Assertions