No exporter named jackson supports java.lang.String
I have to get the json export for a sling model in another sling model. The code that works is:
String exportedJson = modelFactory.exportModelForResource(resource, "jackson",
String.class, new HashMap<String, String>());
This works when the code actually executes, but when I am trying to write a junit for this, I get the error, No exporter named jackson supports java.lang.String
I decompiled the jar, and saw that String class is supported, but I am guessing the JacksonExporter is not getting binded at the time of running the test.
AemContext provides a mock implementation of the ModelFactory service
So, am I missing something ?
Regards,
Ankush Dhingra