aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeandro Alves <leandroalves@yahooinc.com>2022-03-14 23:16:06 +0100
committerLeandro Alves <leandroalves@yahooinc.com>2022-03-14 23:16:06 +0100
commit65f2907ca912a53cca21f6b8f5d901e673b5a0d6 (patch)
tree3c928d2167bf5487300e3f0ca3ad522ac6338db2
parent7a4a57c3c7774ddb13bbf6477a8881da167607ac (diff)
draft tenant info contacts test
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java
index 3c693bf4991..9e643e993ce 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java
@@ -89,19 +89,26 @@ public class ApplicationApiCloudTest extends ControllerContainerCloudTest {
tester.assertResponse(infoRequest, "{}", 200);
String partialInfo = "{\"contactName\":\"newName\", \"contactEmail\": \"foo@example.com\", \"billingContact\":{\"name\":\"billingName\"}}";
-
var postPartial =
request("/application/v4/tenant/scoober/info", PUT)
.data(partialInfo)
.roles(Set.of(Role.administrator(tenantName)));
tester.assertResponse(postPartial, "{\"message\":\"Tenant info updated\"}", 200);
+ String partialContacts = "\"contacts\": [{\"audience\": [\"tenant\"],\"email\": \"contact1@example.com\"}]";
+ var postPartialContacts =
+ request("/application/v4/tenant/scoober/info", PUT)
+ .data(partialContacts)
+ .roles(Set.of(Role.administrator(tenantName)));
+ tester.assertResponse(postPartialContacts, "{\"message\":\"Tenant info updated\"}", 200);
+
// Read back the updated info
tester.assertResponse(infoRequest, "{\"name\":\"\",\"email\":\"\",\"website\":\"\",\"contactName\":\"newName\",\"contactEmail\":\"foo@example.com\",\"billingContact\":{\"name\":\"billingName\",\"email\":\"\",\"phone\":\"\"}}", 200);
String fullAddress = "{\"addressLines\":\"addressLines\",\"postalCodeOrZip\":\"postalCodeOrZip\",\"city\":\"city\",\"stateRegionProvince\":\"stateRegionProvince\",\"country\":\"country\"}";
String fullBillingContact = "{\"name\":\"name\",\"email\":\"foo@example\",\"phone\":\"phone\",\"address\":" + fullAddress + "}";
- String fullInfo = "{\"name\":\"name\",\"email\":\"foo@example\",\"website\":\"https://yahoo.com\",\"contactName\":\"contactName\",\"contactEmail\":\"contact@example.com\",\"address\":" + fullAddress + ",\"billingContact\":" + fullBillingContact + "}";
+ String fullContacts = "[{\"audience\": [\"tenant\"], \"email\": \"contact1@example.com\"},{\"audience\": [\"notification\"],\"email\": \"contact2@example.com\"},{\"audience\": [\"tenant\", \"notification\"],\"email\": \"contact3@example.com\"}]";
+ String fullInfo = "{\"name\":\"name\",\"email\":\"foo@example\",\"website\":\"https://yahoo.com\",\"contactName\":\"contactName\",\"contactEmail\":\"contact@example.com\",\"address\":" + fullAddress + ",\"billingContact\":" + fullBillingContact + ",\"contacts\":" + fullContacts + "}";
// Now set all fields
var postFull =