@Test public void readValueShouldParseRightsObject() throws Exception { String username = "username"; Rights actual = testee.forParsing() .readValue("{\"" + username + "\" : [\"a\", \"e\"]}", Rights.class); assertThat(actual) .isEqualTo(Rights.builder() .delegateTo(Username.of(username), Rights.Right.Administer, Rights.Right.Expunge) .build()); }
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();  }