@Test
public void testValidation() {

	try {
		ImageRect rect = new ImageRect("0,0,0,10");
		rect.validate();
		fail("The validation should fail but it did not.");
	} catch (GenericRestException e) {
		Assert.assertException(e, BAD_REQUEST, "image_error_parameter_positive", ImageManipulationParameters.RECT_QUERY_PARAM_KEY, "0");
	}
	try {
		ImageRect rect = new ImageRect("0,0,10,0");
		rect.validate();
		fail("The validation should fail but it did not.");
	} catch (GenericRestException e) {
		Assert.assertException(e, BAD_REQUEST, "image_error_parameter_positive", ImageManipulationParameters.RECT_QUERY_PARAM_KEY, "0");
	}
	try {
		ImageRect rect = new ImageRect("-1,0,10,10");
		rect.validate();
		fail("The validation should fail but it did not.");
	} catch (GenericRestException e) {
		Assert.assertException(e, BAD_REQUEST, "image_error_crop_start_not_negative", ImageManipulationParameters.RECT_QUERY_PARAM_KEY, "-1");
	}
	try {
		ImageRect rect = new ImageRect("0,-1,10,10");
		rect.validate();
		fail("The validation should fail but it did not.");
	} catch (GenericRestException e) {
		Assert.assertException(e, BAD_REQUEST, "image_error_crop_start_not_negative", ImageManipulationParameters.RECT_QUERY_PARAM_KEY, "-1");
	}
	ImageRect rect = new ImageRect("0,0,1,1");
	rect.validate();
}