All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.masterthought.cucumber.json.deserializers.CommentsDeserializer Maven / Gradle / Ivy

Go to download

Provides pretty html reports for Cucumber (Behaviour-Driven Development). It works by generating html from the cucumber json report formatter. So can be used anywhere a json report is generated. Current use is in the cucumber jenkins plugin and a maven mojo to generate the same report from mvn command line when running locally.

There is a newer version: 5.8.4
Show newest version
package net.masterthought.cucumber.json.deserializers;

import com.fasterxml.jackson.databind.JsonNode;
import net.masterthought.cucumber.Configuration;

import java.util.ArrayList;
import java.util.List;

public class CommentsDeserializer extends CucumberJsonDeserializer> {

    @Override
    protected List deserialize(JsonNode rootNode, Configuration configuration) {
        List comments = new ArrayList<>();
        for (JsonNode commentNode : rootNode) {
            if (commentNode.isTextual()) {
                comments.add(commentNode.asText());
            }
            if (commentNode.isObject() && commentNode.has("value")) {
                comments.add(commentNode.get("value").asText());
            }
        }

        return comments;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy