MailboxACLJsonConverter { public static MailboxACL toACL(String jsonACLString) throws IOException { return objectMapper.readValue(jsonACLString, MailboxACL.class); }  static String toJson(MailboxACL acl); static MailboxACL toACL(String jsonACLString);  }
@Test void emptyACLShouldBeWellDeSerialized() throws Exception { assertThat(MailboxACLJsonConverter.toACL("{\"entries\":{}}")).isEqualTo(MailboxACL.EMPTY); }
@Test void singleUserEntryACLShouldBeWellDeSerialized() throws Exception { assertThatJson(MailboxACLJsonConverter.toACL("{\"entries\":{\"-user\":\"klprstwx\"}}")) .isEqualTo(new ACLMapBuilder().addSingleUserEntryToMap().buildAsACL()); }
@Test void singleGroupEntryACLShouldBeWellDeSerialized() throws Exception { assertThatJson(MailboxACLJsonConverter.toACL("{\"entries\":{\"-$group\":\"lprstwx\"}}")) .isEqualTo(new ACLMapBuilder().addSingleGroupEntryToMap().buildAsACL()); }
@Test void multipleEntriesACLShouldBeWellDeSerialized() throws Exception { assertThatJson(MailboxACLJsonConverter.toACL("{\"entries\":{\"-user\":\"klprstwx\",\"-$group\":\"lprstwx\"}}")) .isEqualTo(new ACLMapBuilder().addSingleUserEntryToMap().addSingleGroupEntryToMap().buildAsACL()); }