I can change Converters#registerAll(GsonBuilder) to the following, and all tests still pass:
public static GsonBuilder registerAll(GsonBuilder builder)
{
if (builder == null) { throw new NullPointerException("builder cannot be null"); }
// registerLocalDate(builder);
// registerLocalDateTime(builder);
// registerLocalTime(builder);
// registerOffsetDateTime(builder);
// registerOffsetTime(builder);
registerZonedDateTime(builder);
return builder;
}
ConvertersTest should probably convert Container to a JsonTree and compare values against what is returned using the converters directly. In my example, LocalDate becomes {"year":2014,"month":12,"day":11}, which is deserialised without a problem.
UPDATE:
Just saw that this is the case for ALL tests. I can comment out the type adapter registration and the test still passes. So essentially nothing is being tested.
I can change Converters#registerAll(GsonBuilder) to the following, and all tests still pass:
ConvertersTest should probably convert Container to a JsonTree and compare values against what is returned using the converters directly. In my example, LocalDate becomes
{"year":2014,"month":12,"day":11}
, which is deserialised without a problem.UPDATE:
Just saw that this is the case for ALL tests. I can comment out the type adapter registration and the test still passes. So essentially nothing is being tested.