From 857e30da3ad83f5a8a6fc9c93c01cf4b3b3f3c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Petrov?= Date: Fri, 16 Feb 2024 11:01:48 +0100 Subject: [PATCH] test http code --- e2e/e2e_central_traits_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/e2e_central_traits_test.go b/e2e/e2e_central_traits_test.go index 5b9cbe36d0..07af1bcdec 100644 --- a/e2e/e2e_central_traits_test.go +++ b/e2e/e2e_central_traits_test.go @@ -2,6 +2,7 @@ package e2e import ( "context" + "net/http" "os" "time" @@ -82,8 +83,11 @@ var _ = Describe("central traits", Ordered, func() { _, err = adminAPI.GetCentralTrait(ctx, id, "test-trait") Expect(err).ToNot(HaveOccurred(), "no error on checking for existing trait") - _, err = adminAPI.GetCentralTrait(ctx, id, "test-trait-2") + resp, err := adminAPI.GetCentralTrait(ctx, id, "test-trait-2") Expect(err).To(HaveOccurred(), "error on checking for non-existing trait") + if Expect(resp).NotTo(BeNil()) { + Expect(resp.StatusCode == http.StatusNotFound).To(BeTrue()) + } _, err = adminAPI.DeleteCentralTrait(ctx, id, "test-trait") Expect(err).ToNot(HaveOccurred(), "no error on deleting test-trait")