|
|
|
@ -53,7 +53,7 @@ public class MethodValidationTests {
@@ -53,7 +53,7 @@ public class MethodValidationTests {
|
|
|
|
|
ProxyFactory proxyFactory = new ProxyFactory(bean); |
|
|
|
|
proxyFactory.addAdvice(new MethodValidationInterceptor()); |
|
|
|
|
proxyFactory.addAdvisor(new AsyncAnnotationAdvisor()); |
|
|
|
|
doTestProxyValidation((MyValidInterface) proxyFactory.getProxy()); |
|
|
|
|
doTestProxyValidation((MyValidInterface<?>) proxyFactory.getProxy()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@ -69,6 +69,7 @@ public class MethodValidationTests {
@@ -69,6 +69,7 @@ public class MethodValidationTests {
|
|
|
|
|
ac.close(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" }) |
|
|
|
|
private void doTestProxyValidation(MyValidInterface proxy) { |
|
|
|
|
assertThat(proxy.myValidMethod("value", 5)).isNotNull(); |
|
|
|
|
assertThatExceptionOfType(ValidationException.class).isThrownBy(() -> |
|
|
|
@ -88,6 +89,7 @@ public class MethodValidationTests {
@@ -88,6 +89,7 @@ public class MethodValidationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@SuppressWarnings("resource") |
|
|
|
|
public void testLazyValidatorForMethodValidation() { |
|
|
|
|
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext( |
|
|
|
|
LazyMethodValidationConfig.class, CustomValidatorBean.class, |
|
|
|
@ -96,6 +98,7 @@ public class MethodValidationTests {
@@ -96,6 +98,7 @@ public class MethodValidationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@SuppressWarnings("resource") |
|
|
|
|
public void testLazyValidatorForMethodValidationWithProxyTargetClass() { |
|
|
|
|
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext( |
|
|
|
|
LazyMethodValidationConfigWithProxyTargetClass.class, CustomValidatorBean.class, |
|
|
|
|