use of com.fasterxml.jackson.databind.SerializationConfig in project jackson-databind by FasterXML.
the class EnumValuesTest method testConstructFromName.
@SuppressWarnings("unchecked")
public void testConstructFromName() {
SerializationConfig cfg = MAPPER.getSerializationConfig().without(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
Class<Enum<?>> enumClass = (Class<Enum<?>>) (Class<?>) ABC.class;
EnumValues values = EnumValues.construct(cfg, enumClass);
assertEquals("A", values.serializedValueFor(ABC.A).toString());
assertEquals("B", values.serializedValueFor(ABC.B).toString());
assertEquals("C", values.serializedValueFor(ABC.C).toString());
assertEquals(3, values.values().size());
assertEquals(3, values.internalMap().size());
}
Aggregations