When writing unit tests, it's common to use fixtures: little testable data, so we can say: 1. Get all clients should include Willy Wonka. 2. Delete client 3, and now get clients should not include Willy Wonka anymore.
That's fine for unit tests. Use setup/teardown to re-load the fixtures or rollback the transaction. So testing creates, updates, and deletes are done inside a transaction. The new temporary data lasts just for the length of that test, then is reset.
But what about when we've separated the REST server from the REST client?
We want to make sure our REST client is not just reading correctly, but creating, updating, and deleting correctly.
I haven't been able to find any examples or suggestions for how to do this against a remote test REST server.
Assuming I've got a test REST server serving only fixtures. The whole stateless nature of HTTP means it'd be hard to send a "BEGIN TRANSACTION" and "ROLLBACK TRANSACTION" or "RELOAD FIXTURES" type of message, right?
I can't be the first to want to do this, so I have a feeling I need a different way of thinking about this.