website.automate.waml.io.WamlWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of waml-io Show documentation
Show all versions of waml-io Show documentation
(De)Serializer of the web automation markup language (WAML) for Java
package website.automate.waml.io;
import java.io.OutputStream;
import java.util.List;
import website.automate.waml.io.model.Scenario;
import com.fasterxml.jackson.databind.ObjectMapper;
public class WamlWriter {
private ObjectMapper objectMapper = WamlConfig.getInstance().getMapper();
public void write(OutputStream scenarioStream, List scenarios){
try {
for(Scenario scenario : scenarios){
objectMapper.writeValue(scenarioStream, scenario);
}
} catch (Exception e) {
throw new WamlSerializationException("Unable to write the suite to desired format.", e);
}
}
}