Skip to content

Commit da0a8b8

Browse files
committed
GH-1463: added test case for string concatenation with request mappings from parent classes with attribute names
1 parent 27f4456 commit da0a8b8

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/RequestMappingSymbolProviderTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ void testMappingPathFromSuperclassWithStringConcatenation() throws Exception {
257257
assertTrue(containsSymbol(symbols, "@/superpath/subclass", docUri, 6, 1, 6, 34));
258258
}
259259

260+
@Test
261+
void testMappingPathFromSuperclassWithStringConcatenationPerAttribute() throws Exception {
262+
String docUri = directory.toPath().resolve("src/main/java/org/test/inheritance/SubclassWithMappingFromParentWithStringConcatenationPerAttribute.java").toUri().toString();
263+
List<? extends WorkspaceSymbol> symbols = indexer.getSymbols(docUri);
264+
assertEquals(1, symbols.size());
265+
assertTrue(containsSymbol(symbols, "@/superpath/subclass", docUri, 6, 1, 6, 42));
266+
}
267+
260268
@Test
261269
void testMappingPathFromSuperclassWithMethodsAndPathAttribute() throws Exception {
262270
String docUri = directory.toPath().resolve("src/main/java/org/test/inheritance/SubclassWithMappingFromParentWithMethods.java").toUri().toString();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.test.inheritance;
2+
3+
import org.springframework.web.bind.annotation.RequestMapping;
4+
5+
public class SubclassWithMappingFromParentWithStringConcatenationPerAttribute extends SuperclassWithMappingPathWithStringConcatenationPerAttribute {
6+
7+
@RequestMapping(value = "/sub" + "class")
8+
public String hello() {
9+
return "Hello";
10+
}
11+
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.test.inheritance;
2+
3+
import org.springframework.web.bind.annotation.RequestMapping;
4+
5+
@RequestMapping(path = "/super" + "path")
6+
public class SuperclassWithMappingPathWithStringConcatenationPerAttribute {
7+
}

0 commit comments

Comments
 (0)