Skip to content

Commit

Permalink
GH-1463: added test case for string concatenation with request mappin…
Browse files Browse the repository at this point in the history
…gs from parent classes
  • Loading branch information
martinlippert committed Feb 11, 2025
1 parent 83c1d74 commit 27f4456
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ void testMappingPathFromSuperclassWithConstant() throws Exception {
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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.test.inheritance;

import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("/super" + "path")
public class SuperclassWithMappingPathWithStringConcatenation {
}

0 comments on commit 27f4456

Please sign in to comment.