summaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TestReport.java
blob: 789a909b7808e86a52702c79f920a3dfdecdaed3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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);
    }

}