Search in sources :

Example 6 with ScrewdriverId

use of com.yahoo.vespa.hosted.controller.api.identifiers.ScrewdriverId in project vespa by vespa-engine.

the class ApplicationApiTest method deployment_fails_on_illegal_domain_in_deployment_spec.

@Test
public void deployment_fails_on_illegal_domain_in_deployment_spec() throws IOException {
    ContainerControllerTester controllerTester = new ContainerControllerTester(container, responseFiles);
    ContainerTester tester = controllerTester.containerTester();
    ApplicationPackage applicationPackage = new ApplicationPackageBuilder().upgradePolicy("default").athenzIdentity(com.yahoo.config.provision.AthenzDomain.from("invalid.domain"), com.yahoo.config.provision.AthenzService.from("service")).environment(Environment.prod).region("us-west-1").build();
    long screwdriverProjectId = 123;
    createAthenzDomainWithAdmin(ATHENZ_TENANT_DOMAIN, USER_ID);
    Application application = controllerTester.createApplication(ATHENZ_TENANT_DOMAIN.getName(), "tenant1", "application1");
    ScrewdriverId screwdriverId = new ScrewdriverId(Long.toString(screwdriverProjectId));
    controllerTester.authorize(ATHENZ_TENANT_DOMAIN, screwdriverId, ApplicationAction.deploy, application);
    tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/test/region/us-east-1/instance/default/", POST).data(createApplicationDeployData(applicationPackage, Optional.of(screwdriverProjectId))).screwdriverIdentity(screwdriverId), "{\"error-code\":\"FORBIDDEN\",\"message\":\"Athenz domain in deployment.xml: [invalid.domain] must match tenant domain: [domain1]\"}", 403);
}
Also used : ContainerControllerTester(com.yahoo.vespa.hosted.controller.restapi.ContainerControllerTester) ScrewdriverId(com.yahoo.vespa.hosted.controller.api.identifiers.ScrewdriverId) ApplicationPackageBuilder(com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder) ContainerTester(com.yahoo.vespa.hosted.controller.restapi.ContainerTester) ApplicationPackage(com.yahoo.vespa.hosted.controller.application.ApplicationPackage) Application(com.yahoo.vespa.hosted.controller.Application) ControllerContainerTest(com.yahoo.vespa.hosted.controller.restapi.ControllerContainerTest) Test(org.junit.Test)

Aggregations

ScrewdriverId (com.yahoo.vespa.hosted.controller.api.identifiers.ScrewdriverId)6 DeployOptions (com.yahoo.vespa.hosted.controller.api.application.v4.model.DeployOptions)4 ScrewdriverBuildJob (com.yahoo.vespa.hosted.controller.api.application.v4.model.ScrewdriverBuildJob)4 Application (com.yahoo.vespa.hosted.controller.Application)3 GitRevision (com.yahoo.vespa.hosted.controller.api.application.v4.model.GitRevision)3 GitBranch (com.yahoo.vespa.hosted.controller.api.identifiers.GitBranch)3 GitCommit (com.yahoo.vespa.hosted.controller.api.identifiers.GitCommit)3 GitRepository (com.yahoo.vespa.hosted.controller.api.identifiers.GitRepository)3 ApplicationPackage (com.yahoo.vespa.hosted.controller.application.ApplicationPackage)3 Test (org.junit.Test)3 ZoneId (com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId)2 Joiner (com.google.common.base.Joiner)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Inject (com.google.inject.Inject)1 Version (com.yahoo.component.Version)1 DeploymentSpec (com.yahoo.config.application.api.DeploymentSpec)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1 ApplicationName (com.yahoo.config.provision.ApplicationName)1 Environment (com.yahoo.config.provision.Environment)1 RegionName (com.yahoo.config.provision.RegionName)1