API Testing with Rest Assured - Validating the json schema
Sometimes you would get a json response while testing web applications. To make sure that all fields are present, but at the same time keeping the tests generic, you might write something like this given below.(although, a newbie way of writing tests) @Category(RegressionTests.class) @Test public void verifyResponseByValidatingPresenceOfAllFields() { given(). param("product", "HomeLoan"). param("fromHomeLoanId", -100). when(). get("/loans"). then(). statusCode(200). contentType(ContentType.JSON). body(containsString("loans"))....