@Test void deserializeShouldThrowOnMalformedData() { assertThatThrownBy(() -> mailboxIdDeserializer.deserialize(MALFORMED_SERIALIZED_ID)) .isInstanceOf(MailboxIdDeserialisationException.class); }
@Override public MaildirId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException { try { return MaildirId.fromString(serializedMailboxId); } catch (Exception e) { throw new MailboxIdDeserialisationException("Can not deserialize " + serializedMailboxId, e); } }
MaildirMailboxIdDeserializer implements MailboxIdDeserializer { @Override public MaildirId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException { try { return MaildirId.fromString(serializedMailboxId); } catch (Exception e) { throw new MailboxIdDeserialisationException("Can not deserialize " + serializedMailboxId, e); } } }
MaildirMailboxIdDeserializer implements MailboxIdDeserializer { @Override public MaildirId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException { try { return MaildirId.fromString(serializedMailboxId); } catch (Exception e) { throw new MailboxIdDeserialisationException("Can not deserialize " + serializedMailboxId, e); } }  }
MaildirMailboxIdDeserializer implements MailboxIdDeserializer { @Override public MaildirId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException { try { return MaildirId.fromString(serializedMailboxId); } catch (Exception e) { throw new MailboxIdDeserialisationException("Can not deserialize " + serializedMailboxId, e); } }  @Override MaildirId deserialize(String serializedMailboxId); }
MaildirMailboxIdDeserializer implements MailboxIdDeserializer { @Override public MaildirId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException { try { return MaildirId.fromString(serializedMailboxId); } catch (Exception e) { throw new MailboxIdDeserialisationException("Can not deserialize " + serializedMailboxId, e); } }  @Override MaildirId deserialize(String serializedMailboxId);  }