本文整理了Java中org.assertj.core.api.AbstractListAssert.are()
方法的一些代码示例,展示了AbstractListAssert.are()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractListAssert.are()
方法的具体详情如下:
包路径:org.assertj.core.api.AbstractListAssert
类名称:AbstractListAssert
方法名:are
暂无
代码示例来源:origin: ubiratansoares/rxassertions
TestSubscriberAssertionsWrapper<T> eachItemMatches(Condition<? super T> condition) {
assertThat(onNextEvents).are(condition);
return this;
}
代码示例来源:origin: Nike-Inc/wingtips
private void assertBinaryAnnotationsAreEmptyOrOnlyHaveStringTags(zipkin.Span span) {
//Asserts that binary annotations should be empty or only contain tags (string type)
Condition<BinaryAnnotation> stringTypeOnly = new Condition<BinaryAnnotation>() {
public boolean matches(BinaryAnnotation value) {
return value.type == BinaryAnnotation.Type.STRING && !Constants.CORE_ANNOTATIONS.contains(value.key);
}
};
assertThat(span.binaryAnnotations).are(stringTypeOnly);
}
代码示例来源:origin: commercetools/commercetools-jvm-sdk
@Test
public void findMatchingVariantByFulltextSearch() throws Exception {
final Condition<ProductVariant> allMatchingVariants = new Condition<>(variant -> variant.isMatchingVariant(), "all are matching variants");
final ProductProjectionSearch search = ProductProjectionSearch.ofStaged().withMarkingMatchingVariants(true).withText(ENGLISH, "shoe");
assertThat(executeSearch(search).getResults())
.flatExtracting(p -> p.getAllVariants())
.are(allMatchingVariants);
}
代码示例来源:origin: org.apache.james/james-server-jmap
@Test
public void processShouldReturnPropertyFilterWhenFilteringHeadersRequested() throws Exception {
MessageManager inbox = mailboxManager.getMailbox(inboxPath, session);
ComposedMessageId message1 = inbox.appendMessage(
AppendCommand.from(
org.apache.james.mime4j.dom.Message.Builder.of()
.setFrom("user@domain.tld")
.setField(new RawField("header1", "Header1Content"))
.setField(new RawField("HEADer2", "Header2Content"))
.setSubject("message 1 subject")
.setBody("my message", StandardCharsets.UTF_8)),
session);
GetMessagesRequest request = GetMessagesRequest.builder()
.ids(ImmutableList.of(message1.getMessageId()))
.properties(ImmutableList.of("headers.from", "headers.heADER2"))
.build();
List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
assertThat(result)
.hasSize(1)
.extracting(JmapResponse::getFilterProvider)
.are(new Condition<>(Optional::isPresent, "present"));
SimpleFilterProvider actualFilterProvider = result.get(0).getFilterProvider().get();
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setFilterProvider(actualFilterProvider.setDefaultFilter(SimpleBeanPropertyFilter.serializeAll()));
String response = objectMapper.writer().writeValueAsString(result.get(0));
assertThat(JsonPath.parse(response).<Map<String, String>>read("$.response.list[0].headers")).containsOnly(MapEntry.entry("From", "user@domain.tld"), MapEntry.entry("HEADer2", "Header2Content"));
}
内容来源于网络,如有侵权,请联系作者删除!