Skip to content

Commit

Permalink
adapt named annotation tests to improved component bean name implemen…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
martinlippert committed Jan 17, 2025
1 parent 4e90e81 commit 2a11dbf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ void testNamedAnnotationJakarta() throws Exception {
String docUri = directory.toPath().resolve("src/main/java/org/test/jakarta/NamedComponentWithSpecificName.java").toUri().toString();

SpringIndexerHarness.assertDocumentSymbols(indexer, docUri,
SpringIndexerHarness.symbol("@Named(\"specificallyNamedComponent\")", "@+ 'namedComponentWithSpecificName' (@Named) NamedComponentWithSpecificName")
SpringIndexerHarness.symbol("@Named(\"specificallyNamedComponent\")", "@+ 'specificallyNamedComponent' (@Named) NamedComponentWithSpecificName")
);

Bean[] beans = springIndex.getBeansOfDocument(docUri);
assertEquals(1, beans.length);

assertEquals("namedComponentWithSpecificName", beans[0].getName());
assertEquals("specificallyNamedComponent", beans[0].getName());
assertEquals("org.test.jakarta.NamedComponentWithSpecificName", beans[0].getType());
}

Expand All @@ -96,13 +96,13 @@ void testNamedAnnotationJavax() throws Exception {
String docUri = directory.toPath().resolve("src/main/java/org/test/javax/NamedComponentWithSpecificName.java").toUri().toString();

SpringIndexerHarness.assertDocumentSymbols(indexer, docUri,
SpringIndexerHarness.symbol("@Named(\"specificallyNamedComponent\")", "@+ 'namedComponentWithSpecificName' (@Named) NamedComponentWithSpecificName")
SpringIndexerHarness.symbol("@Named(\"specificallyNamedComponent\")", "@+ 'specificallyNamedComponent' (@Named) NamedComponentWithSpecificName")
);

Bean[] beans = springIndex.getBeansOfDocument(docUri);
assertEquals(1, beans.length);

assertEquals("namedComponentWithSpecificName", beans[0].getName());
assertEquals("specificallyNamedComponent", beans[0].getName());
assertEquals("org.test.javax.NamedComponentWithSpecificName", beans[0].getType());
}

Expand Down

0 comments on commit 2a11dbf

Please sign in to comment.