#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:
Oliver Gierke
2016-10-28 09:43:23 +02:00
parent a7f8a2c698
commit d8b7dcbca1
2 changed files with 15 additions and 2 deletions

View File

@@ -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;

View File

@@ -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();
}