@@ -0,0 +1,3006 @@
+package com.yahoo.vespa.hosted.controller.restapi.application;%0A%0Aimport com.yahoo.config.provision.ApplicationId;%0Aimport com.yahoo.config.provision.TenantName;%0Aimport com.yahoo.vespa.hosted.controller.api.role.Role;%0Aimport com.yahoo.vespa.hosted.controller.restapi.ContainerTester;%0Aimport com.yahoo.vespa.hosted.controller.restapi.ControllerContainerCloudTest;%0Aimport com.yahoo.vespa.hosted.controller.security.CloudTenantSpec;%0Aimport com.yahoo.vespa.hosted.controller.security.Credentials;%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0Aimport java.util.Optional;%0Aimport java.util.Set;%0A%0Aimport static com.yahoo.application.container.handler.Request.Method.PATCH;%0Aimport static com.yahoo.application.container.handler.Request.Method.POST;%0A%0Apublic class CloudApplicationApiTest extends ControllerContainerCloudTest %7B%0A%0A    private static final String responseFiles = %22src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/%22;%0A%0A    private static final String publicKey = %22-----BEGIN PUBLIC KEY-----%5Cn%22 +%0A                                                 %22MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuKVFA8dXk43kVfYKzkUqhEY2rDT9%5Cn%22 +%0A                                                 %22z/4jKSTHwbYR8wdsOSrJGVEUPbS2nguIJ64OJH7gFnxM6sxUVj+Nm2HlXw==%5Cn%22 +%0A                                                 %22-----END PUBLIC KEY-----%5Cn%22;%0A%0A    private static final String privateKey = %22-----BEGIN EC PRIVATE KEY-----%5Cn%22 +%0A                                                  %22MHcCAQEEIJUmbIX8YFLHtpRgkwqDDE3igU9RG6JD9cYHWAZii9j7oAoGCCqGSM49%5Cn%22 +%0A                                                  %22AwEHoUQDQgAEuKVFA8dXk43kVfYKzkUqhEY2rDT9z/4jKSTHwbYR8wdsOSrJGVEU%5Cn%22 +%0A                                                  %22PbS2nguIJ64OJH7gFnxM6sxUVj+Nm2HlXw==%5Cn%22 +%0A                                                  %22-----END EC PRIVATE KEY-----%5Cn%22;%0A%0A    @Test%0A    public void testResponses() %7B%0A        ContainerTester tester = new ContainerTester(container, responseFiles);%0A        ApplicationId id = ApplicationId.from(%22my-tenant%22, %22my-app%22, %22default%22);%0A        Optional%3CCredentials%3E credentials = Optional.of(new Credentials(() -%3E %22user%22));%0A%0A        // Create an application.%0A        tester.controller().tenants().create(new CloudTenantSpec(TenantName.from(%22my-tenant%22), %22token%22), credentials.get());%0A        tester.controller().applications().createApplication(id, credentials);%0A%0A        // PATCH in a pem deploy key.%0A        tester.assertResponse(request(%22/application/v4/tenant/my-tenant/application/my-app%22, PATCH)%0A                                      .roles(Set.of(Role.hostedOperator()))%0A                                      .data(%22%7B%5C%22pemDeployKey%5C%22:%5C%22%22 + publicKey + %22%5C%22%7D%22),%0A                              %22%7B%5C%22message%5C%22:%5C%22Set pem deploy key to %22 +%0A                              publicKey.replaceAll(%22%5C%5Cn%22, %22%5C%5C%5C%5Cn%22) + %22%5C%22%7D%22);%0A%0A        tester.assertResponse(request(%22/application/v4/tenant/my-tenant/application/my-application/instance/default/submit%22, POST)%0A                             .roles());%0A    %7D%0A%0A%7D%0A

Add test for SignatureFilter