示例#1
0
  @Test
  public void ensureConfigSerializable() throws Exception {
    final ObjectMapper mapper = Jackson.newObjectMapper();
    mapper
        .getSubtypeResolver()
        .registerSubtypes(ServiceFinder.find(AppenderFactory.class).toClassArray());

    // Issue-96: some types were not serializable
    final String json = mapper.writeValueAsString(configuration);
    assertThat(json).isNotNull();

    // and as an added bonus, let's see we can also read it back:
    final Configuration cfg = mapper.readValue(json, Configuration.class);
    assertThat(cfg).isNotNull();
  }
示例#2
0
 public ViewBundle() {
   this(ServiceFinder.find(ViewRenderer.class));
 }