@Test public void testInvalidSettingsAreSkippedAndValidSettingsAreApplied() throws IOException { withTestModel(new TestModelWithDate()); withSettings("Invalid.Setting=EXPECTED ERROR", "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS=false"); initializeModelSerializer(); serialize(); assertJsonIs("{\"date\":\"1970-01-01T00:00:00.000+0000\"}"); withSettings("Invalid.Setting=EXPECTED ERROR", "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS=true"); initializeModelSerializer(); serialize(); assertJsonIs("{\"date\":0}"); }
void serialize(@Nonnull PrintWriter writer, @Nonnull Object model) throws IOException { this.jsonFactory .createGenerator(writer) .setCodec(this.mapper) .writeObject(model); }
Jackson2ModelSerializer { void serialize(@Nonnull PrintWriter writer, @Nonnull Object model) throws IOException { this.jsonFactory .createGenerator(writer) .setCodec(this.mapper) .writeObject(model); } }
Jackson2ModelSerializer { void serialize(@Nonnull PrintWriter writer, @Nonnull Object model) throws IOException { this.jsonFactory .createGenerator(writer) .setCodec(this.mapper) .writeObject(model); } Jackson2ModelSerializer(@Nonnull Supplier<Map<Object, Mapping<?>>> recordedMappingsSupplier, @Nonnull String[] jacksonConfigurations, boolean addTypeAttribute); }
Jackson2ModelSerializer { void serialize(@Nonnull PrintWriter writer, @Nonnull Object model) throws IOException { this.jsonFactory .createGenerator(writer) .setCodec(this.mapper) .writeObject(model); } Jackson2ModelSerializer(@Nonnull Supplier<Map<Object, Mapping<?>>> recordedMappingsSupplier, @Nonnull String[] jacksonConfigurations, boolean addTypeAttribute);  }
Jackson2ModelSerializer { void serialize(@Nonnull PrintWriter writer, @Nonnull Object model) throws IOException { this.jsonFactory .createGenerator(writer) .setCodec(this.mapper) .writeObject(model); } Jackson2ModelSerializer(@Nonnull Supplier<Map<Object, Mapping<?>>> recordedMappingsSupplier, @Nonnull String[] jacksonConfigurations, boolean addTypeAttribute);   }