Polishing

This commit is contained in:
Juergen Hoeller
2016-08-26 13:27:33 +02:00
parent a8f7f75f64
commit 14046575b0
6 changed files with 23 additions and 18 deletions

View File

@@ -933,18 +933,21 @@ public class MvcNamespaceTests {
public @interface IsoDate {
}
@NumberFormat(style = NumberFormat.Style.PERCENT)
@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface PercentNumber {
}
@Validated(MyGroup.class)
@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface MyValid {
}
@Controller
public static class TestController {
@@ -955,13 +958,16 @@ public class MvcNamespaceTests {
private boolean recordedValidationError;
@RequestMapping
public void testBind(@RequestParam @IsoDate Date date, @RequestParam(required = false) @PercentNumber Double percent, @MyValid TestBean bean, BindingResult result) {
public void testBind(@RequestParam @IsoDate Date date,
@RequestParam(required = false) @PercentNumber Double percent,
@MyValid TestBean bean, BindingResult result) {
this.date = date;
this.percent = percent;
this.recordedValidationError = (result.getErrorCount() == 1);
}
}
public static class TestValidator implements Validator {
boolean validatorInvoked;
@@ -977,10 +983,12 @@ public class MvcNamespaceTests {
}
}
@Retention(RetentionPolicy.RUNTIME)
public @interface MyGroup {
}
private static class TestBean {
@NotNull(groups = MyGroup.class)
@@ -997,6 +1005,7 @@ public class MvcNamespaceTests {
}
}
private static class TestMockServletContext extends MockServletContext {
@Override
@@ -1015,12 +1024,15 @@ public class MvcNamespaceTests {
}
}
public static class TestCallableProcessingInterceptor extends CallableProcessingInterceptorAdapter {
}
public static class TestDeferredResultProcessingInterceptor extends DeferredResultProcessingInterceptorAdapter {
}
public static class TestPathMatcher implements PathMatcher {
@Override
@@ -1059,9 +1071,11 @@ public class MvcNamespaceTests {
}
}
public static class TestPathHelper extends UrlPathHelper {
}
public static class TestCacheManager implements CacheManager {
@Override

View File

@@ -62,6 +62,7 @@ public class GroovyMarkupViewTests {
this.servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.webAppContext);
}
@Test
public void missingGroovyMarkupConfig() throws Exception {
GroovyMarkupView view = new GroovyMarkupView();