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