use of org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBeansModel in project sts4 by spring-projects.
the class LiveHoverUtils method findRelevantBeans.
public static Stream<LiveBean> findRelevantBeans(SpringBootApp app, LiveBean definedBean) {
LiveBeansModel beansModel = app.getBeans();
if (beansModel != null) {
Stream<LiveBean> relevantBeans = beansModel.getBeansOfName(definedBean.getId()).stream();
String type = definedBean.getType();
if (type != null) {
relevantBeans = relevantBeans.filter(bean -> type.equals(bean.getType(true)));
}
return relevantBeans;
}
return Stream.empty();
}
use of org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBeansModel in project sts4 by spring-projects.
the class LiveBeansModelTest method testEmptyModel.
@Test
public void testEmptyModel() throws Exception {
String json = IOUtils.toString(getResourceAsStream("/live-beans-models/empty-live-beans-model.json"));
LiveBeansModel model = LiveBeansModel.parse(json);
List<LiveBean> bean = model.getBeansOfType("org.test.DependencyA");
assertEquals(0, bean.size());
}
Aggregations