From a16d905456dffe3be0f706242a0844cd6853ae8b Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Mon, 15 Jan 2024 17:52:29 +0100 Subject: [PATCH] test: use randomized group name --- test/c8y_test/user_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/c8y_test/user_test.go b/test/c8y_test/user_test.go index b4ea6d1a..d557e8bb 100644 --- a/test/c8y_test/user_test.go +++ b/test/c8y_test/user_test.go @@ -218,15 +218,16 @@ func TestUserService_GetUsersByGroup(t *testing.T) { testingutils.Equals(t, http.StatusOK, resp.StatusCode()) // Create temp group + name := "group" + testingutils.RandomString(8) group, resp, err := client.User.CreateGroup( context.Background(), &c8y.Group{ - Name: "CustomCIGroup", + Name: name, }, ) testingutils.Ok(t, err) testingutils.Equals(t, http.StatusCreated, resp.StatusCode()) - testingutils.Equals(t, "CustomCIGroup", group.Name) + testingutils.Equals(t, name, group.Name) // Add user to temp group _, resp, err = client.User.AddUserToGroup( @@ -251,16 +252,17 @@ func TestUserService_GetUsersByGroup(t *testing.T) { testingutils.Equals(t, userReferences.References[0].User.Username, currentUser.Username) // Update temp group + updatedName := name + "-UpdatedName" updatedGroup, resp, err := client.User.UpdateGroup( context.Background(), group.GetID(), &c8y.Group{ - Name: "CustomCIGroup-UpdatedName", + Name: updatedName, }, ) testingutils.Ok(t, err) testingutils.Equals(t, http.StatusOK, resp.StatusCode()) - testingutils.Equals(t, "CustomCIGroup-UpdatedName", updatedGroup.Name) + testingutils.Equals(t, updatedName, updatedGroup.Name) // Remove temp group resp, err = client.User.DeleteGroup(