aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/test/java/com/yahoo/config/provision/CloudNameTest.java
blob: b030233d4594dfb62c7bf3124de0868457befcc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Yahoo. 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 static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
 * @author freva
 */
class CloudNameTest {

    @Test
    void returns_same_instance_for_known_clouds() {
        assertSame(CloudName.from("aws"), CloudName.AWS);
        assertSame(CloudName.from("gcp"), CloudName.GCP);
        assertSame(CloudName.from("default"), CloudName.DEFAULT);
        assertSame(CloudName.from("yahoo"), CloudName.YAHOO);
        assertThrows(IllegalArgumentException.class, () -> CloudName.from("aWs")); // Must be lower case
    }
}