From 7c45066f7c38da3d3d81cd62fba264249b6dc5cc Mon Sep 17 00:00:00 2001 From: mcorbin Date: Thu, 4 Jul 2024 10:53:33 +0200 Subject: [PATCH] Fix integration tests for pushgateway changes --- internal/http/integration_test.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/internal/http/integration_test.go b/internal/http/integration_test.go index 5d77036..2e212f8 100644 --- a/internal/http/integration_test.go +++ b/internal/http/integration_test.go @@ -746,12 +746,9 @@ func TestIntegration(t *testing.T) { // delete 2 first metrics by name DeletePushgatewayMetrics := testCase{ - url: "/api/v1/pushgateway", + url: fmt.Sprintf("/api/v1/pushgateway/%s", pushgatewayMetricInput.Name), expectedStatus: 200, - payload: client.DeletePushgatewayMetricInput{ - Identifier: pushgatewayMetricInput.Name, - }, - method: "DELETE", + method: "DELETE", headers: map[string]string{ "Authorization": basicAuth(testUser, testPassword), }, @@ -775,12 +772,9 @@ func TestIntegration(t *testing.T) { // delete by ID DeletePushgatewayMetrics = testCase{ - url: "/api/v1/pushgateway", + url: fmt.Sprintf("/api/v1/pushgateway/%s", listMetricsResult.Result[0].ID), expectedStatus: 200, - payload: client.DeletePushgatewayMetricInput{ - Identifier: listMetricsResult.Result[0].ID, - }, - method: "DELETE", + method: "DELETE", headers: map[string]string{ "Authorization": basicAuth(testUser, testPassword), }, @@ -877,8 +871,8 @@ func TestIntegration(t *testing.T) { }, { url: "/api/v1/pushgateway", - expectedStatus: 400, - body: "Field validation for", + expectedStatus: 404, + body: "Not Found", method: "DELETE", headers: map[string]string{ "Authorization": basicAuth(testUser, testPassword),