@Test(expected = MailboxIdDeserialisationException.class) public void deserializeShouldThrowOnMalformedData() throws MailboxIdDeserialisationException { mailboxIdDeserializer.deserialize(MALFORMED_SERIALIZED_ID); }
@Test(expected = MailboxIdDeserialisationException.class) public void deserializeShouldThrowOnMalformedData() throws Exception { mailboxIdDeserializer.deserialize(MALFORMED_SERIALIZED_ID); }
@Test public void deserializeShouldWork() throws Exception { assertThat(mailboxIdDeserializer.deserialize(SERIALIZED_ID)).isEqualTo(JCR_ID); }
@Test public void deserializeShouldWork() throws MailboxIdDeserialisationException { assertThat(mailboxIdDeserializer.deserialize(SERIALIZED_ID)).isEqualTo(IN_MEMORY_ID); }
@Test public void deserializeShouldWork() throws Exception { assertThat(mailboxIdDeserializer.deserialize(SERIALIZED_ID)).isEqualTo(MAILDIR_ID); }
public Mailbox retrieveMailbox(MailboxDataTransferObject mailboxDataTransferObject) { SimpleMailbox mailbox = new SimpleMailbox(new MailboxPath(mailboxDataTransferObject.getNamespace(), mailboxDataTransferObject.getUser(), mailboxDataTransferObject.getName()), mailboxDataTransferObject.getUidValidity()); try { mailbox.setACL(MailboxACLJsonConverter.toACL(mailboxDataTransferObject.getSerializedACL())); mailbox.setMailboxId(mailboxIdDeserializer.deserialize(mailboxDataTransferObject.getSerializedMailboxId())); } catch (IOException e) { LOGGER.warn("Failed to deserialize ACL", e); } catch (MailboxIdDeserialisationException e) { LOGGER.warn("Failed to deserialize mailbox ID", e); } return mailbox; }