DATACMNS-419 - PagedResourceAssemblerArgumentResolver now works with templated URIs.
We now handle an IllegalArgumentException being thrown in case we deal with a templated request mapping. We simply skip the attempt to eagerly resolve the base URI for the request and rely on the assembler being capable of resolving it itself or the user effectively providing a Link instances to one of the toResource(…) overloads.
This commit is contained in:
@@ -128,6 +128,18 @@ public class PagedResourcesAssemblerArgumentResolverUnitTests {
|
||||
assertRejectsAmbiguity("noMatchingQualifiers");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-419
|
||||
*/
|
||||
@Test
|
||||
public void doesNotFailForTemplatedMethodMapping() throws Exception {
|
||||
|
||||
Method method = Controller.class.getMethod("methodWithPathVariable", PagedResourcesAssembler.class);
|
||||
Object result = resolver.resolveArgument(new MethodParameter(method, 0), null, null, null);
|
||||
|
||||
assertThat(result, is(notNullValue()));
|
||||
}
|
||||
|
||||
private void assertSelectsParameter(Method method, int expectedIndex) throws Exception {
|
||||
|
||||
MethodParameter parameter = new MethodParameter(method, 0);
|
||||
|
||||
Reference in New Issue
Block a user