#471 - Polishing.
Fixed imports and reinstantiated old unit test to make sure we actually test both scenarios. Original pull request: #497.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.hateoas.core;
|
||||
|
||||
import static org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotation;
|
||||
import static org.springframework.core.annotation.AnnotatedElementUtils.*;
|
||||
import static org.springframework.core.annotation.AnnotationUtils.*;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
@@ -141,12 +141,25 @@ public class AnnotationMappingDiscovererUnitTest {
|
||||
assertThat(discoverer.getMapping(method), is("/type/method"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #471
|
||||
*/
|
||||
@Test
|
||||
public void discoversMethodLevelMappingUsingComposedAnnotation() throws Exception {
|
||||
|
||||
Method method = MyController.class.getMethod("methodWithComposedAnnotation");
|
||||
assertThat(discoverer.getMapping(method), is("/type/otherMethod"));
|
||||
}
|
||||
|
||||
@RequestMapping("/type")
|
||||
interface MyController {
|
||||
|
||||
@GetMapping("/method")
|
||||
@RequestMapping("/method")
|
||||
void method();
|
||||
|
||||
@GetMapping("/otherMethod")
|
||||
void methodWithComposedAnnotation();
|
||||
|
||||
@RequestMapping
|
||||
void noMethodMapping();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user