本文整理了Java中org.assertj.core.api.ListAssert.hasAtLeastOneElementOfType()
方法的一些代码示例,展示了ListAssert.hasAtLeastOneElementOfType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListAssert.hasAtLeastOneElementOfType()
方法的具体详情如下:
包路径:org.assertj.core.api.ListAssert
类名称:ListAssert
方法名:hasAtLeastOneElementOfType
暂无
代码示例来源:origin: line/armeria
@Test
public void configurator() throws Exception {
assertThat(jettyBeans)
.hasAtLeastOneElementOfType(ThreadPool.class)
.hasAtLeastOneElementOfType(WebAppContext.class);
}
代码示例来源:origin: stagemonitor/stagemonitor
@Test
public void testRestTemplateHasInterceptor() throws Exception {
final List<RestTemplate> restTemplates = Arrays.asList(
new RestTemplate(),
new RestTemplate(new SimpleClientHttpRequestFactory()),
new RestTemplate(Collections.singletonList(new StringHttpMessageConverter())));
for (RestTemplate restTemplate : restTemplates) {
assertThat(restTemplate.getInterceptors()).hasSize(1);
assertThat(restTemplate.getInterceptors()).hasAtLeastOneElementOfType(SpringRestTemplateContextPropagatingInterceptor.class);
}
}
代码示例来源:origin: palantir/atlasdb
private void assertCheckerHasMatchingCheckers(List<Supplier<Checker>> checkerList, JepsenHistoryChecker checker) {
checkerList.forEach(
supplier -> assertThat(checker.getCheckers()).hasAtLeastOneElementOfType(supplier.get().getClass()));
}
}
内容来源于网络,如有侵权,请联系作者删除!