use of com.dtflys.forest.converter.json.ForestFastjsonConverter in project forest by dromara.
the class TestForestFastjsonConverter method testSerializerFeature.
@Test
public void testSerializerFeature() {
ForestFastjsonConverter forestFastjsonConverter = new ForestFastjsonConverter();
String defaultSerializerFeatureName = forestFastjsonConverter.getSerializerFeatureName();
SerializerFeature defaultSerializerFeature = forestFastjsonConverter.getSerializerFeature();
assertEquals(SerializerFeature.DisableCircularReferenceDetect.name(), defaultSerializerFeatureName);
assertEquals(defaultSerializerFeature.name(), defaultSerializerFeatureName);
forestFastjsonConverter.setSerializerFeatureName(SerializerFeature.WriteClassName.name());
assertEquals(SerializerFeature.WriteClassName.name(), forestFastjsonConverter.getSerializerFeatureName());
assertEquals(SerializerFeature.WriteClassName, forestFastjsonConverter.getSerializerFeature());
forestFastjsonConverter.setSerializerFeature(SerializerFeature.BeanToArray);
assertEquals(SerializerFeature.BeanToArray.name(), forestFastjsonConverter.getSerializerFeatureName());
assertEquals(SerializerFeature.BeanToArray, forestFastjsonConverter.getSerializerFeature());
}
Aggregations