// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.deployment;

/**
 * @author mortent
 */
public class TestReport {
    private final String report;

    private TestReport(String report) {
        this.report = report;
    }

    public String toJson() {
        return report;
    }

    public static TestReport fromJson(String report) {
        return new TestReport(report);
    }
}

// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.deployment;

import com.yahoo.slime.SlimeUtils;

import java.nio.charset.StandardCharsets;

/**
 * @author mortent
 */
public class TestReport {

    private final String report;

    private TestReport(String report) {
        this.report = report;
    }

    public String toJson() {
        return report;
    }

    public static TestReport fromJson(String report) {
        SlimeUtils.jsonToSlimeOrThrow(report.getBytes(StandardCharsets.UTF_8)); // Verify structure.
        return new TestReport(report);
    }

}

Verify JSON when passing test report through controller
Verify JSON when passing test report through controller
