aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/container/jdisc/state/HostLifeGathererTest.java
blob: 28b4aff26fed36a2450a7d2f501dacd5147574cd (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 Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.jdisc.state;

import com.fasterxml.jackson.databind.JsonNode;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;


/**
 * @author olaa
 */
public class HostLifeGathererTest {

    @Test
    void host_is_alive() {
        JsonNode packet = HostLifeGatherer.getHostLifePacket();
        JsonNode metrics = packet.get("metrics");
        assertEquals("host_life", packet.get("application").textValue());
        assertEquals(1, metrics.get("alive").intValue());
        assertTrue(packet.get("dimensions").hasNonNull("vespaVersion"));
    }
}