Permalink
Browse files

Merge pull request #469 from marceloemanoel/master

Update on Servlet3 error messages of file limit exceed
  • Loading branch information...
lucascs committed Oct 16, 2012
2 parents e471518 + 64a2eb3 commit ca750b9da36e2a26ab19ca32fb73ffd3f73b522f
@@ -39,7 +39,7 @@
import br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor;
import br.com.caelum.vraptor.ioc.RequestScoped;
import br.com.caelum.vraptor.resource.ResourceMethod;
-import br.com.caelum.vraptor.validator.Validations;
+import br.com.caelum.vraptor.validator.I18nMessage;
import com.google.common.base.Strings;
import com.google.common.collect.HashMultiset;
@@ -158,12 +158,7 @@ public void intercept(InterceptorStack stack, ResourceMethod method, Object reso
* @param e
*/
protected void reportSizeLimitExceeded(final IllegalStateException e) {
- validator.checking(new Validations() {
- {
- that(false, "upload", "servlet3.upload.filesize.exceeded");
- }
- });
-
+ validator.add(new I18nMessage("upload", "servlet3.upload.filesize.exceeded"));
logger.warn("The file size limit was exceeded.", e);
}
@@ -30,7 +30,7 @@
import br.com.caelum.vraptor.core.InterceptorStack;
import br.com.caelum.vraptor.http.MutableRequest;
import br.com.caelum.vraptor.resource.ResourceMethod;
-import br.com.caelum.vraptor.validator.Validations;
+import br.com.caelum.vraptor.validator.I18nMessage;
/**
* Test class for uploading features with servlet 3.
@@ -206,7 +206,7 @@ public void shouldValidateWhenSizeLimitExceededExceptionOccurs() throws Exceptio
interceptor.intercept(stack, method, instance);
- verify(validator).checking(any(Validations.class));
+ verify(validator).add(any(I18nMessage.class));
}
@Test(expected = InterceptionException.class)

0 comments on commit ca750b9

Please sign in to comment.