Hi I am having a strange issue I am using spring data rest with spring boot for my rest api . Also I am doing some customization via jackson modules to add a custom BeanSerializerModifier to perform some filtering opertaions.The weird part is the beanserializer works fine while using eclipse test cases which is the below method
public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc,
List<BeanPropertyWriter> beanProperties){
is applied to each class entity as well as spring data rest wrappers like PagedResources and HalLinks .But when I run the same via maven test cases it doesn't get applied (or gets skipped) on entity classes not sure why ?
the code how I am registering jackson modules is as below
@Configuration
public class JacksonCustomizations {
private @Autowired FilteringSerializerModifier serializerModifier;
@Autowired(required = true)
public void configeJackson(Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder) {
jackson2ObjectMapperBuilder.modules(new HfdServicesModule());
}
/*
* @Autowired CustomIntrospector customIntrospector;
*/
/* public @Bean Module hfServicesModule() {
return new HfServicesModule();
}*/
@SuppressWarnings("serial")
class HfdServicesModule extends SimpleModule {
public HfServicesModule() {
setSerializerModifier(serializerModifier);
}
@Override
public void setupModule(SetupContext context) {
super.setupModule(context);
}
}
Let me know what I am missing .