GH-1451: component symbol provider now takes attribute value into account when calculating the bean name
Fixes GH-1451
This commit is contained in:
@@ -145,6 +145,22 @@ public class SpringIndexerBeansTest {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testScanComponentClassWithName() throws Exception {
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/SpecialNameComponent.java").toUri().toString();
|
||||
SpringIndexerHarness.assertDocumentSymbols(indexer, docUri,
|
||||
SpringIndexerHarness.symbol("@Component(\"specialName\")", "@+ 'specialName' (@Component) SpecialNameComponent")
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testScanComponentClassWithNameAndAttributeName() throws Exception {
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/SpecialNameComponentWithAttributeName.java").toUri().toString();
|
||||
SpringIndexerHarness.assertDocumentSymbols(indexer, docUri,
|
||||
SpringIndexerHarness.symbol("@Component(value = \"specialNameWithAttributeName\")", "@+ 'specialNameWithAttributeName' (@Component) SpecialNameComponentWithAttributeName")
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testScanSimpleControllerClass() throws Exception {
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/SimpleController.java").toUri().toString();
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.test;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component(value = "specialNameWithAttributeName")
|
||||
public class SpecialNameComponentWithAttributeName {
|
||||
}
|
||||
Reference in New Issue
Block a user