diff options
author | Andreas Eriksen <andreer@verizonmedia.com> | 2020-06-11 10:31:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 10:31:20 +0200 |
commit | 54828b73bcea1d086b145453b318bfdcdfef93b8 (patch) | |
tree | 958584a90f51ce2d6ea58c2f57b5da34a9a44878 /controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/UserApiTest.java | |
parent | 1aaaa34cc41bc4bcf8f9448c637e8ee5fa551200 (diff) |
tenant creation for everyone in public (with restrictions/gated by flag) (#13538)
* tenant creation for everyone in public (with restrictions/gated by flag)
* always include feature flag value in user api
Co-authored-by: Jon Marius Venstad <jonmv@users.noreply.github.com>
Diffstat (limited to 'controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/UserApiTest.java')
-rw-r--r-- | controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/UserApiTest.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/UserApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/UserApiTest.java index c066c50ca20..d9ad30020db 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/UserApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/UserApiTest.java @@ -4,6 +4,8 @@ package com.yahoo.vespa.hosted.controller.restapi.user; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.TenantName; +import com.yahoo.vespa.flags.Flags; +import com.yahoo.vespa.flags.InMemoryFlagSource; import com.yahoo.vespa.hosted.controller.ControllerTester; import com.yahoo.vespa.hosted.controller.api.integration.user.User; import com.yahoo.vespa.hosted.controller.api.role.Role; @@ -62,7 +64,7 @@ public class UserApiTest extends ControllerContainerCloudTest { // POST a tenant is not available to everyone. tester.assertResponse(request("/application/v4/tenant/my-tenant", POST) .data("{\"token\":\"hello\"}"), - accessDenied, 403); + "{\"error-code\":\"FORBIDDEN\",\"message\":\"You are not currently permitted to create tenants. Please contact the Vespa team to request access.\"}", 403); // POST a tenant is available to operators. tester.assertResponse(request("/application/v4/tenant/my-tenant", POST) @@ -200,6 +202,8 @@ public class UserApiTest extends ControllerContainerCloudTest { @Test public void userMetadataTest() { ContainerTester tester = new ContainerTester(container, responseFiles); + ((InMemoryFlagSource) tester.controller().flagSource()) + .withBooleanFlag(Flags.ENABLE_PUBLIC_SIGNUP_FLOW.id(), true); ControllerTester controller = new ControllerTester(tester); Set<Role> operator = Set.of(Role.hostedOperator(), Role.hostedSupporter(), Role.hostedAccountant()); User user = new User("dev@domail", "Joe Developer", "dev", null); |