Revised InvocableHandlerMethod exception messages (controller vs endpoint vs handler)

Introduces dedicated MethodArgumentResolutionException for spring-messaging invocations.

Issue: SPR-15139
(cherry picked from commit 047786a)
This commit is contained in:
Juergen Hoeller
2017-01-16 21:14:46 +01:00
parent 0655d73f8e
commit 8656e30550
8 changed files with 167 additions and 128 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -93,7 +93,7 @@ public class InvocableHandlerMethodTests {
fail("Expected exception");
}
catch (IllegalStateException ex) {
assertTrue(ex.getMessage().contains("No suitable resolver for argument [0] [type=java.lang.Integer]"));
assertTrue(ex.getMessage().contains("No suitable resolver for argument 0 of type 'java.lang.Integer'"));
}
}
@@ -192,7 +192,7 @@ public class InvocableHandlerMethodTests {
catch (IllegalStateException actual) {
assertNotNull(actual.getCause());
assertSame(expected, actual.getCause());
assertTrue(actual.getMessage().contains("Failed to invoke controller method"));
assertTrue(actual.getMessage().contains("Failed to invoke handler method"));
}
}