aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/test/java/com/yahoo/config/provision/SystemNameTest.java
blob: 0e3e2b105318e4201eca1159e55c720395bb96ba (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision;

import org.junit.jupiter.api.Test;

import java.util.Set;

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

/**
 * @author hakonhall
 */
public class SystemNameTest {
    @Test
    void test() {
        for (SystemName name : SystemName.values()) {
            assertEquals(name, SystemName.from(name.value()));
        }
    }

    @Test
    void allOf() {
        assertEquals(Set.of(SystemName.cd, SystemName.PublicCd, SystemName.PublicCdMigration), SystemName.allOf(SystemName::isCd));
        assertEquals(Set.of(SystemName.PublicCd, SystemName.Public, SystemName.PublicCdMigration), SystemName.allOf(SystemName::isPublic));
    }
}