aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/config/model/provision/HostSpecTest.java
blob: a2c0f258e1487178ca493cb16832f440a2b832d1 (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
34
35
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.model.provision;

import com.yahoo.config.provision.HostSpec;
import org.junit.jupiter.api.Test;
import java.util.Optional;

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

/**
 * @author Ulf Lilleengen
 */
public class HostSpecTest {

    @Test
    void testEquals() {
        HostSpec h1 = new HostSpec("foo", Optional.empty());
        HostSpec h2 = new HostSpec("foo", Optional.empty());
        HostSpec h3 = new HostSpec("bar", Optional.empty());

        assertEquals(h1, h1);
        assertEquals(h1, h2);
        assertNotEquals(h1, h3);

        assertEquals(h2, h1);
        assertEquals(h2, h2);
        assertNotEquals(h2, h3);

        assertNotEquals(h3, h1);
        assertNotEquals(h3, h2);
        assertEquals(h3, h3);
    }

}