@Test public void mailboxIdShouldBeSerializable() throws Exception { MailboxIdTestContainer container = new MailboxIdTestContainer(InMemoryId.of(123)); String expectedJson = "{\"mailboxId\":\"123\"}"; String actual = testee.forWriting().writeValueAsString(container); assertThat(actual).isEqualTo(expectedJson); }
public ObjectMapper forWriting() { return new ObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .registerModules(jacksonModules); }
ObjectMapperFactory { public ObjectMapper forWriting() { return new ObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .registerModules(jacksonModules); } }
ObjectMapperFactory { public ObjectMapper forWriting() { return new ObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .registerModules(jacksonModules); } @Inject  ObjectMapperFactory(MailboxId.Factory mailboxIdFactory, MessageId.Factory messageIdFactory); }
ObjectMapperFactory { public ObjectMapper forWriting() { return new ObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .registerModules(jacksonModules); } @Inject  ObjectMapperFactory(MailboxId.Factory mailboxIdFactory, MessageId.Factory messageIdFactory); ObjectMapper forParsing(); ObjectMapper forWriting(); }
ObjectMapperFactory { public ObjectMapper forWriting() { return new ObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .registerModules(jacksonModules); } @Inject  ObjectMapperFactory(MailboxId.Factory mailboxIdFactory, MessageId.Factory messageIdFactory); ObjectMapper forParsing(); ObjectMapper forWriting();  }