aboutsummaryrefslogtreecommitdiffstats
path: root/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/ProcessResultTest.java
blob: 590833151f276105bfc94940b92f682b6d2495c1 (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.dockerapi;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class ProcessResultTest {
    @Test
    public void testBasicProperties() {
        ProcessResult processResult = new ProcessResult(0, "foo", "bar");
        assertEquals(0, processResult.getExitStatus());
        assertEquals("foo", processResult.getOutput());
        assertTrue(processResult.isSuccess());
    }

    @Test
    public void testSuccessFails() {
        ProcessResult processResult = new ProcessResult(1, "foo", "bar");
        assertFalse(processResult.isSuccess());
    }
}