@Test public void readValueShouldParseUsernameObject() throws Exception { String username = "username"; Username actual = testee.forParsing() .readValue("\"" + username + "\"", Username.class); assertThat(actual) .isEqualTo(Username.of(username)); }
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();  }