Testing multiple Http status codes

You want to test a controller for a range of different http status codes, this can be useful when you have one method for matching returned data – but sometimes the http code returned alters. Or if you just want to check if the code is a 2xx etc.

The Spring.3.2 test would something like this : http://pastebin.com/ZcAf6EmK

And it would rely on a new implementation of Springs ResultMatcher, which would look like this : http://pastebin.com/ns6jf7SQ


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: