blob: f3a523f279c68e20ccfbdfde81258150712ca1dd (
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
29
30
31
32
33
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.orchestrator.status;
import com.yahoo.jdisc.test.TestTimer;
import com.yahoo.vespa.orchestrator.status.json.WireHostInfo;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
/**
* @author hakonhall
*/
public class HostInfoTest {
private final TestTimer timer = new TestTimer();
@Before
public void setUp() {
timer.setMillis(3L);
}
@Test
public void equality() {
HostInfo info1 = HostInfo.createSuspended(HostStatus.ALLOWED_TO_BE_DOWN, timer.currentTime());
assertNotEquals(info1, HostInfo.createNoRemarks());
assertNotEquals(info1, HostInfo.createSuspended(HostStatus.PERMANENTLY_DOWN, timer.currentTime()));
byte[] serialized = WireHostInfo.serialize(info1);
HostInfo deserialized1 = WireHostInfo.deserialize(serialized);
assertEquals(info1, deserialized1);
}
}
|