On 10 June 2013 20:49, Bhargav Golla <bhargav.go...@gmail.com> wrote:
> > 1. Delete_thenResponseCode_205_bad: Should I check for a DELETE request > and then check for response code? > Not sure what you mean by "check for" a DELETE request. You need to submit an HTTP DELETE in the client, and then assert in the client that you get a 205 response. There's a good chance, though, that this test will fail - ie that the server does not correctly implement this behaviour. You are very welcome to dig into it if so.... will probably involve some rooting around in RestEasy and the JAX-RS. However, if you get nowhere, then skip this test and find something easier to work on (at least, while you are coming up to speed). Such as... > > 2. Get_thenResponseHeaders_ContentLength_ok: What is the content length I > should check for? > With these, the easiest thing is to just assert on a nonsense value, have the test fail, and then (so long as you've manually verified that the response looks ok), take this content length as the one to check for. What we're after here is a regression test; there's no easy way - other than manual inspection - to figure out the initial value. For a slightly more robust test, you might want to check that the content length is larger than some value. After all, if there are changes it'll probably involve the addition of new members to the class; which would break this content length test. All we want is a "reasonableness" check here, ie "yes, a content length was returned, and yes, it looks about right". Thx Dan >