@@ -87,6 +87,13 @@ void testScanSimpleFunctionClass() throws Exception {
8787 SpringIndexerHarness .assertDocumentSymbols (indexer , docUri ,
8888 SpringIndexerHarness .symbol ("ScannedFunctionClass" , "@> 'scannedFunctionClass' Function<String,String>" )
8989 );
90+
91+ Bean [] beans = springIndex .getBeansOfDocument (docUri );
92+ assertEquals (1 , beans .length );
93+
94+ Bean functionClassBean = Arrays .stream (beans ).filter (bean -> bean .getName ().equals ("scannedFunctionClass" )).findFirst ().get ();
95+
96+ assertEquals ("org.test.ScannedFunctionClass" , functionClassBean .getType ());
9097 }
9198
9299 @ Test
@@ -95,6 +102,13 @@ void testScanSpecializedFunctionClass() throws Exception {
95102 SpringIndexerHarness .assertDocumentSymbols (indexer , docUri ,
96103 SpringIndexerHarness .symbol ("FunctionFromSpecializedClass" , "@> 'functionFromSpecializedClass' Function<String,String>" )
97104 );
105+
106+ Bean [] beans = springIndex .getBeansOfDocument (docUri );
107+ assertEquals (1 , beans .length );
108+
109+ Bean functionClassBean = Arrays .stream (beans ).filter (bean -> bean .getName ().equals ("functionFromSpecializedClass" )).findFirst ().get ();
110+
111+ assertEquals ("org.test.FunctionFromSpecializedClass" , functionClassBean .getType ());
98112 }
99113
100114 @ Test
@@ -103,18 +117,31 @@ void testScanSpecializedFunctionInterface() throws Exception {
103117 SpringIndexerHarness .assertDocumentSymbols (indexer , docUri ,
104118 SpringIndexerHarness .symbol ("FunctionFromSpecializedInterface" , "@> 'functionFromSpecializedInterface' Function<String,String>" )
105119 );
120+
121+ Bean [] beans = springIndex .getBeansOfDocument (docUri );
122+ assertEquals (1 , beans .length );
123+
124+ Bean functionClassBean = Arrays .stream (beans ).filter (bean -> bean .getName ().equals ("functionFromSpecializedInterface" )).findFirst ().get ();
125+
126+ assertEquals ("org.test.FunctionFromSpecializedInterface" , functionClassBean .getType ());
106127 }
107128
108129 @ Test
109130 void testNoSymbolForAbstractClasses () throws Exception {
110131 String docUri = directory .toPath ().resolve ("src/main/java/org/test/SpecializedFunctionClass.java" ).toUri ().toString ();
111132 SpringIndexerHarness .assertDocumentSymbols (indexer , docUri );
133+
134+ Bean [] beans = springIndex .getBeansOfDocument (docUri );
135+ assertEquals (0 , beans .length );
112136 }
113137
114138 @ Test
115139 void testNoSymbolForSubInterfaces () throws Exception {
116140 String docUri = directory .toPath ().resolve ("src/main/java/org/test/SpecializedFunctionInterface.java" ).toUri ().toString ();
117141 SpringIndexerHarness .assertDocumentSymbols (indexer , docUri );
142+
143+ Bean [] beans = springIndex .getBeansOfDocument (docUri );
144+ assertEquals (0 , beans .length );
118145 }
119146
120147}
0 commit comments