@Test public void mailboxIdShouldBeDeserializable() throws Exception { String json = "{ \"mailboxId\": \"123\"}"; MailboxIdTestContainer expected = new MailboxIdTestContainer(InMemoryId.of(123)); MailboxIdTestContainer actual = testee.forParsing().readValue(json, MailboxIdTestContainer.class); assertThat(actual).isEqualToComparingFieldByField(expected); }
public ObjectMapper forParsing() { return new ObjectMapper() .registerModules(jacksonModules) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); }
ObjectMapperFactory { public ObjectMapper forParsing() { return new ObjectMapper() .registerModules(jacksonModules) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); } }
ObjectMapperFactory { public ObjectMapper forParsing() { return new ObjectMapper() .registerModules(jacksonModules) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); } @Inject  ObjectMapperFactory(MailboxId.Factory mailboxIdFactory, MessageId.Factory messageIdFactory); }
ObjectMapperFactory { public ObjectMapper forParsing() { return new ObjectMapper() .registerModules(jacksonModules) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); } @Inject  ObjectMapperFactory(MailboxId.Factory mailboxIdFactory, MessageId.Factory messageIdFactory); ObjectMapper forParsing(); ObjectMapper forWriting(); }
ObjectMapperFactory { public ObjectMapper forParsing() { return new ObjectMapper() .registerModules(jacksonModules) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); } @Inject  ObjectMapperFactory(MailboxId.Factory mailboxIdFactory, MessageId.Factory messageIdFactory); ObjectMapper forParsing(); ObjectMapper forWriting();  }