What you actually need in this test, is just post appointment first (it should return id to you), only in this case you could get appointments by id.
Or you should always keep in mind, that your DB  should always contain record with id equal 0
Make your tests more flexible and not so hardcoded