本文整理了Java中org.assertj.core.api.IterableAssert.withFailMessage()
方法的一些代码示例,展示了IterableAssert.withFailMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IterableAssert.withFailMessage()
方法的具体详情如下:
包路径:org.assertj.core.api.IterableAssert
类名称:IterableAssert
方法名:withFailMessage
暂无
代码示例来源:origin: spring-projects/spring-security
@Test
public void testNullDefaultAuthorities() {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
"user", "password");
assertThat(jaasProvider.supports(UsernamePasswordAuthenticationToken.class)).isTrue();
Authentication auth = jaasProvider.authenticate(token);
assertThat(auth
.getAuthorities()).withFailMessage("Only ROLE_TEST1 and ROLE_TEST2 should have been returned").hasSize(2);
}
代码示例来源:origin: org.apache.james/apache-mailet-base
@Test
public void testAllMatch() throws MessagingException {
MatcherInverter inverter = new MatcherInverter(new GenericMatcher() {
@Override
public Collection<MailAddress> match(Mail mail) throws MessagingException {
return null;
}
});
FakeMail mail = FakeMail.builder()
.recipient(new MailAddress("user", "domain"))
.build();
assertThat(inverter.match(mail)).withFailMessage("Should match all recipients").isNotNull();
}
代码示例来源:origin: org.apache.james/apache-mailet-base
@Test
public void testNonMatch() throws MessagingException {
final MailAddress address1 = new MailAddress("user", "domain");
final MailAddress address2 = new MailAddress("user", "domain2");
MatcherInverter inverter = new MatcherInverter(new GenericMatcher() {
@Override
public Collection<MailAddress> match(Mail mail) throws MessagingException {
return mail.getRecipients();
}
});
FakeMail mail = FakeMail.builder()
.recipients(address1, address2)
.build();
assertThat(inverter.match(mail)).withFailMessage("Should match all recipients").isNull();
}
内容来源于网络,如有侵权,请联系作者删除!