PT #153051451 Symbol for RequestMapping without parameters

This commit is contained in:
BoykoAlex
2017-11-21 17:34:36 -05:00
parent 384b2954fb
commit 2185c7cd1b
3 changed files with 28 additions and 1 deletions

View File

@@ -59,6 +59,18 @@ public class RequestMappingSymbolProviderTest {
assertTrue(containsSymbol(symbols, "@/parent/greeting -- GET", uriPrefix + "/src/main/java/org/test/ParentMappingClass.java", 8, 1, 8, 47));
}
@Test
public void testEmptyPathWithParentRequestMappingSymbol() throws Exception {
harness.intialize(new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI()));
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
String uriPrefix = "file://" + directory.getAbsolutePath();
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(uriPrefix + "/src/main/java/org/test/ParentMappingClass2.java");
assertEquals(1, symbols.size());
assertTrue(containsSymbol(symbols, "@/parent2 -- GET,POST,DELETE", uriPrefix + "/src/main/java/org/test/ParentMappingClass2.java", 8, 1, 8, 16));
}
@Test
public void testMultiRequestMappingSymbol() throws Exception {
harness.intialize(new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI()));

View File

@@ -0,0 +1,12 @@
package org.test;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod.*;
@RequestMapping(value="parent2", method= {GET,POST,DELETE})
public class ParentMappingClass2 {
@RequestMapping
public void nothing() {}
}