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 with attribute names
  • Loading branch information
martinlippert committed Feb 11, 2025
1 parent 27f4456 commit da0a8b8
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 @@ -257,6 +257,14 @@ void testMappingPathFromSuperclassWithStringConcatenation() throws Exception {
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();
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 SubclassWithMappingFromParentWithStringConcatenationPerAttribute extends SuperclassWithMappingPathWithStringConcatenationPerAttribute {

@RequestMapping(value = "/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(path = "/super" + "path")
public class SuperclassWithMappingPathWithStringConcatenationPerAttribute {
}

0 comments on commit da0a8b8

Please sign in to comment.