Make live hovers AnnotationHierarchyAware

This commit is contained in:
Kris De Volder
2017-11-21 11:30:55 -08:00
parent 7136162000
commit 6783ffdbe8
5 changed files with 62 additions and 56 deletions

View File

@@ -300,7 +300,7 @@ public class AutowiredHoverProviderTest {
);
editor.assertHighlights("@Component", "@Autowired", "@Autowired");
for (int i = 1; i <= 2; i++) {
editor.assertHoverContains("@Autowired", 1,
editor.assertHoverContains("@Autowired", i,
"Bean [id: defaultFoo, type: `com.example.FooImplementation`] got autowired with:\n" +
"\n" +
"- Bean: otherBean \n" +
@@ -351,15 +351,16 @@ public class AutowiredHoverProviderTest {
" \n" +
"}"
);
editor.assertHighlights(/* not yet: "@Controller",*/ "@Autowired");
for (int i = 1; i <= 2; i++) {
editor.assertHoverContains("@Autowired", 1,
"Bean [id: myController, type: `com.example.MyController`] got autowired with:\n" +
"\n" +
"- Bean: restTemplate \n" +
" Type: `org.springframework.web.client.RestTemplate`");
}
editor.assertHighlights("@Controller", "@Autowired");
editor.assertHoverContains("@Autowired",
"Bean [id: myController, type: `com.example.MyController`] got autowired with:\n" +
"\n" +
"- Bean: restTemplate \n" +
" Type: `org.springframework.web.client.RestTemplate`"
);
editor.assertHoverContains("@Controller",
"**Injection report for Bean [id: myController, type: `com.example.MyController`]**"
);
}
}

View File

@@ -78,6 +78,7 @@ public class ActiveProfilesHoverTest {
public void testActiveProfileHover_Unknown() throws Exception {
//Sometimes its not possible to determine active profiles for an app (e.g. no actuator dependency).
//Make sure we show something sensible
harness.useProject(projects.mavenProject("no-actuator-boot-15-web-app"));
mockAppProvider.builder()
.isSpringBootApp(true)
@@ -98,8 +99,8 @@ public class ActiveProfilesHoverTest {
"\n" +
"}"
);
editor.assertHoverContains("@Profile", "Process [PID=22022, name=`foo.bar.RunningApp`] : _Unknown_");
editor.assertHighlights("@Profile");
editor.assertHoverContains("@Profile", "Consider adding `spring-boot-actuator` as a dependency");
editor.assertHighlights(/*NONE*/);
}
@Test