GH-1463: added test case for string concatenation with request mappings from parent classes
This commit is contained in:
@@ -249,6 +249,14 @@ public class RequestMappingSymbolProviderTest {
|
||||
assertTrue(containsSymbol(symbols, "@/path/from/constant/", docUri, 6, 1, 6, 21));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMappingPathFromSuperclassWithStringConcatenation() throws Exception {
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/inheritance/SubclassWithMappingFromParentWithStringConcatenation.java").toUri().toString();
|
||||
List<? extends WorkspaceSymbol> symbols = indexer.getSymbols(docUri);
|
||||
assertEquals(1, symbols.size());
|
||||
assertTrue(containsSymbol(symbols, "@/superpath/subclass", docUri, 6, 1, 6, 34));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMappingPathFromSuperclassWithMethodsAndPathAttribute() throws Exception {
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/inheritance/SubclassWithMappingFromParentWithMethods.java").toUri().toString();
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.test.inheritance;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
public class SubclassWithMappingFromParentWithStringConcatenation extends SuperclassWithMappingPathWithStringConcatenation {
|
||||
|
||||
@RequestMapping("/sub" + "class")
|
||||
public String hello() {
|
||||
return "Hello";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.test.inheritance;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@RequestMapping("/super" + "path")
|
||||
public class SuperclassWithMappingPathWithStringConcatenation {
|
||||
}
|
||||
Reference in New Issue
Block a user