REST Assured validates responses in then() with .statusCode(), .statusLine(), .header()/.headers(), .contentType(), and .time() — the first-line checks of any API test.
then().statusCode(200) asserts the numeric status; .statusCode(is(oneOf(200, 201))) allows a set. .header('Content-Type', containsString('json')) and .contentType(ContentType.JSON) validate headers. .time(lessThan(2000L), TimeUnit.MILLISECONDS) asserts performance. .cookie('session', notNullValue()) checks cookies. These validations run against the actual response and fail the test with a clear message showing expected vs actual. Combining a status-code check with a body assertion is the minimum for a meaningful API test — a 200 with the wrong body still indicates a defect.
A smoke test asserts the health endpoint responds fast and correctly: when().get('/health').then().statusCode(200).time(lessThan(1000L), MILLISECONDS).body('status', equalTo('UP')).
Your test only does .statusCode(200) and passes, yet the API returned wrong data. What validation was missing and why does it matter?