Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9801 from vespa-engine/jvenstad/tenant-cd
Jvenstad/tenant cd
- Loading branch information
Showing
4 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
hosted-api/src/test/java/ai/vespa/hosted/api/TestConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package ai.vespa.hosted.api; | ||
|
||
import com.yahoo.config.provision.ApplicationId; | ||
import com.yahoo.config.provision.SystemName; | ||
import com.yahoo.config.provision.zone.ZoneId; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
import java.util.Map; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
/** | ||
* @author jonmv | ||
*/ | ||
public class TestConfigTest { | ||
|
||
@Test | ||
public void testDeserialization() throws IOException { | ||
TestConfig config = TestConfig.fromJson(Files.readAllBytes(Paths.get("src/test/resources/test-config.json"))); | ||
assertEquals(ApplicationId.from("t", "a", "i"), | ||
config.application()); | ||
assertEquals(ZoneId.from("dev", "aws-us-east-1c"), | ||
config.zone()); | ||
assertEquals(SystemName.PublicCd, | ||
config.system()); | ||
assertEquals(Map.of(ZoneId.from("dev", "aws-us-east-1c"), | ||
Map.of("default", URI.create("https://dev.endpoint:443/")), | ||
ZoneId.from("prod", "aws-us-east-1a"), | ||
Map.of("default", URI.create("https://prod.endpoint:443/"))), | ||
config.deployments()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"application": "t:a:i", | ||
"zone": "dev.aws-us-east-1c", | ||
"system": "publiccd", | ||
"zoneEndpoints": { | ||
"dev.aws-us-east-1c": { | ||
"default": "https://dev.endpoint:443/" | ||
}, | ||
"prod.aws-us-east-1a": { | ||
"default": "https://prod.endpoint:443/" | ||
} | ||
} | ||
} |