use of org.talend.dataprep.api.preparation.json.MixedContentMapModule in project data-prep by Talend.
the class ActionMetadataTestUtils method parseParameters.
/**
* Parse the given input stream into a parameter map.
*
* @param input the parameters input stream.
* @return the parsed parameters.
* @throws IOException if an error occurs.
*/
public static Map<String, String> parseParameters(InputStream input) throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new MixedContentMapModule());
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
List<Action> parsedAction = ((Actions) mapper.reader(Actions.class).readValue(input)).getActions();
return parsedAction.get(0).getParameters();
}
Aggregations