use of org.shredzone.acme4j.Identifier in project acme4j by shred.
the class EmailProcessorTest method testEmailParser.
@Test
public void testEmailParser() throws MessagingException {
EmailProcessor processor = new EmailProcessor(message);
processor.expectedFrom(expectedFrom);
processor.expectedTo(expectedTo);
processor.expectedIdentifier(EmailIdentifier.email(expectedTo));
processor.expectedIdentifier(new Identifier("email", expectedTo.getAddress()));
assertThat(processor.getSender()).isEqualTo(expectedFrom);
assertThat(processor.getRecipient()).isEqualTo(expectedTo);
assertThat(processor.getMessageId()).isEqualTo(Optional.of("<A2299BB.FF7788@example.org>"));
assertThat(processor.getToken1()).isEqualTo(TOKEN_PART1);
assertThat(processor.getReplyTo()).contains(email("acme-validator@example.org"));
}
use of org.shredzone.acme4j.Identifier in project acme4j by shred.
the class CSRBuilderTest method testUnknownType.
/**
* Make sure an exception is thrown when an unknown identifier type is used.
*/
@Test
public void testUnknownType() {
IllegalArgumentException iae = assertThrows(IllegalArgumentException.class, () -> {
CSRBuilder builder = new CSRBuilder();
builder.addIdentifier(new Identifier("UnKnOwN", "123"));
});
assertThat(iae.getMessage()).isEqualTo("Unknown identifier type: UnKnOwN");
}
Aggregations