@Test public void testTypeTokenList() throws Exception { JsonCodec<List<Person>> jsonCodec = jsonCodec(new TypeToken<List<Person>>() {}); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testListJsonCodec() throws Exception { JsonCodec<List<Person>> jsonCodec = listJsonCodec(Person.class); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testListJsonCodec() throws Exception { JsonCodec<List<Person>> jsonCodec = listJsonCodec(Person.class); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testListJsonCodec() throws Exception { JsonCodec<List<Person>> jsonCodec = listJsonCodec(Person.class); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testTypeTokenList() throws Exception { JsonCodec<List<Person>> jsonCodec = jsonCodec(new TypeToken<List<Person>>() {}); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testTypeTokenList() throws Exception { JsonCodec<List<Person>> jsonCodec = jsonCodec(new TypeToken<List<Person>>() {}); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testListJsonCodecFromJsonCodec() throws Exception { JsonCodec<List<Person>> jsonCodec = listJsonCodec(jsonCodec(Person.class)); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testListJsonCodecFromJsonCodec() throws Exception { JsonCodec<List<Person>> jsonCodec = listJsonCodec(jsonCodec(Person.class)); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void testListJsonCodecFromJsonCodec() throws Exception { JsonCodec<List<Person>> jsonCodec = listJsonCodec(jsonCodec(Person.class)); Person.validatePersonListJsonCodec(jsonCodec); }
@Test public void test() throws Exception { Injector injector = Guice.createInjector(new JsonModule(), new Module() { public void configure(Binder binder) { JsonCodecBinder codecBinder = jsonCodecBinder(binder); codecBinder.bindJsonCodec(Person.class); codecBinder.bindListJsonCodec(Person.class); codecBinder.bindMapJsonCodec(String.class, Person.class); } }); injector.injectMembers(this); assertNotNull(personJsonCodec); assertNotNull(personListJsonCodec); assertNotNull(personMapJsonCodec); Person.validatePersonJsonCodec(personJsonCodec); Person.validatePersonListJsonCodec(personListJsonCodec); Person.validatePersonMapJsonCodec(personMapJsonCodec); } }
@Test public void testJsonCodecFactoryBinding() throws Exception { Injector injector = Guice.createInjector(new JsonModule()); JsonCodecFactory codecFactory = injector.getInstance(JsonCodecFactory.class); Person.validatePersonJsonCodec(codecFactory.jsonCodec(Person.class)); Person.validatePersonListJsonCodec(codecFactory.listJsonCodec(Person.class)); Person.validatePersonMapJsonCodec(codecFactory.mapJsonCodec(String.class, Person.class)); }
@Test public void testJsonCodecFactoryBinding() throws Exception { Injector injector = Guice.createInjector(new JsonModule()); JsonCodecFactory codecFactory = injector.getInstance(JsonCodecFactory.class); Person.validatePersonJsonCodec(codecFactory.jsonCodec(Person.class)); Person.validatePersonListJsonCodec(codecFactory.listJsonCodec(Person.class)); Person.validatePersonMapJsonCodec(codecFactory.mapJsonCodec(String.class, Person.class)); }
@Test public void testJsonCodecFactoryBinding() throws Exception { Injector injector = Guice.createInjector(new JsonModule()); JsonCodecFactory codecFactory = injector.getInstance(JsonCodecFactory.class); Person.validatePersonJsonCodec(codecFactory.jsonCodec(Person.class)); Person.validatePersonListJsonCodec(codecFactory.listJsonCodec(Person.class)); Person.validatePersonMapJsonCodec(codecFactory.mapJsonCodec(String.class, Person.class)); }
@Test public void test() throws Exception { Injector injector = Guice.createInjector(new JsonModule(), binder -> { JsonCodecBinder codecBinder = jsonCodecBinder(binder); codecBinder.bindJsonCodec(Person.class); codecBinder.bindListJsonCodec(Person.class); codecBinder.bindMapJsonCodec(String.class, Person.class); }); injector.injectMembers(this); assertNotNull(personJsonCodec); assertNotNull(personListJsonCodec); assertNotNull(personMapJsonCodec); Person.validatePersonJsonCodec(personJsonCodec); Person.validatePersonListJsonCodec(personListJsonCodec); Person.validatePersonMapJsonCodec(personMapJsonCodec); } }
@Test public void test() throws Exception { Injector injector = Guice.createInjector(new JsonModule(), binder -> { JsonCodecBinder codecBinder = jsonCodecBinder(binder); codecBinder.bindJsonCodec(Person.class); codecBinder.bindListJsonCodec(Person.class); codecBinder.bindMapJsonCodec(String.class, Person.class); }); injector.injectMembers(this); assertNotNull(personJsonCodec); assertNotNull(personListJsonCodec); assertNotNull(personMapJsonCodec); Person.validatePersonJsonCodec(personJsonCodec); Person.validatePersonListJsonCodec(personListJsonCodec); Person.validatePersonMapJsonCodec(personMapJsonCodec); } }