summaryrefslogtreecommitdiffstats
path: root/controller-server/src/test/java
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@yahooinc.com>2023-10-17 13:56:23 +0200
committerValerij Fredriksen <valerijf@yahooinc.com>2023-10-17 14:42:30 +0200
commit1b718963178ba76b24a7be0996802322625ecc48 (patch)
treee68f844b9f329eb408941d3d5a5e59b6ed20bf87 /controller-server/src/test/java
parentd479a02301e14a7242c84269697a5c70cd4854b5 (diff)
Allow no application resources
Diffstat (limited to 'controller-server/src/test/java')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/pricing/PricingApiHandlerTest.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/pricing/PricingApiHandlerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/pricing/PricingApiHandlerTest.java
index c4b5a771725..f2ce0dfeef2 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/pricing/PricingApiHandlerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/pricing/PricingApiHandlerTest.java
@@ -21,6 +21,12 @@ public class PricingApiHandlerTest extends ControllerContainerCloudTest {
@Test
void testPricingInfoBasic() {
+ tester().assertJsonResponse(request("/pricing/v1/pricing?supportLevel=basic&committedSpend=0"),
+ """
+ { "applications": [ ], "priceInfo": [ ], "totalAmount": "0.00" }
+ """,
+ 200);
+
var request = request("/pricing/v1/pricing?" + urlEncodedPriceInformation1App(BASIC));
tester().assertJsonResponse(request, """
{
@@ -110,10 +116,8 @@ public class PricingApiHandlerTest extends ControllerContainerCloudTest {
]
}
],
- "priceInfo": [
- {"description": "Committed spend", "amount": "-0.20"}
- ],
- "totalAmount": "25.90"
+ "priceInfo": [ ],
+ "totalAmount": "26.10"
}
""",
200);
@@ -128,9 +132,6 @@ public class PricingApiHandlerTest extends ControllerContainerCloudTest {
tester.assertJsonResponse(request("/pricing/v1/pricing?"),
"{\"error-code\":\"BAD_REQUEST\",\"message\":\"Error in query parameter, expected '=' between key and value: ''\"}",
400);
- tester.assertJsonResponse(request("/pricing/v1/pricing?supportLevel=basic&committedSpend=0"),
- "{\"error-code\":\"BAD_REQUEST\",\"message\":\"No application resources found in query\"}",
- 400);
tester.assertJsonResponse(request("/pricing/v1/pricing?supportLevel=basic&committedSpend=0&resources"),
"{\"error-code\":\"BAD_REQUEST\",\"message\":\"Error in query parameter, expected '=' between key and value: 'resources'\"}",
400);