package com.systelab.seed.unit;

import com.systelab.seed.client.RequestException;
import com.systelab.seed.client.UserClient;
import com.systelab.seed.model.user.User;

import java.util.List;
import java.util.logging.Logger;

import org.junit.jupiter.api.*;
import io.qameta.allure.*;


@Feature("User Test Suite")
@DisplayName("User Test Suite")
public class UserClientTest extends BaseClientTest {
    private static final Logger logger = Logger.getLogger(UserClientTest.class.getName());

    public static UserClient clientForUser;

    @BeforeAll
    public static void init() throws RequestException {
        clientForUser = new UserClient();
        login(clientForUser);
    }

    @TmsLink("SEED-USR-1")
    @DisplayName("Test User list")
    @Description("Test that we can get a List of users.")
    @Tag("user")

    @Severity(SeverityLevel.BLOCKER)
    @Test
    public void testGetUserList() throws RequestException {
        login(clientForUser);

        List<User> users = clientForUser.get();

        for (int i = 0; i < users.size(); i++) {
            logger.info(users.get(i).getSurname());
        }

        Assertions.assertNotNull(users);
    }

}

@@ -26,16 +26,51 @@
 .unit;%0A%0A
+import com.systelab.seed.TestUtil;%0A
 import c
@@ -111,16 +111,16 @@
 eption;%0A
-
 import c
@@ -251,24 +251,70 @@
 ng.Logger;%0A%0A
+import com.systelab.seed.model.user.UserRole;%0A
 import org.j
@@ -1247,10 +1247,893 @@
 %0A    %7D%0A%0A
+    @TmsLink(%22SEED-USR-2%22)%0A    @Link(value = %22REQ-USR-2%22, type = %22requirement%22)%0A    @DisplayName(%22Test create a User.%22)%0A    @Description(%22Test that is possible to create a user.%5Cn%5CnPrerequisites:%5Cn%5Cn%22 + %22- Prerequisite 1%5Cn%22 + %22- Prerequisite 2%5Cn%22 + %22- Prerequisite 3%5Cn%22)%0A    @Tag(%22user%22)%0A    @Severity(SeverityLevel.BLOCKER)%0A    @Test%0A    public void testCreateUser() throws RequestException %7B%0A        User user =new User();%0A        user.setLogin(%22agoncalves%22);%0A        user.setPassword(%22agoncalves%22);%0A        user.setName(%22Antonio%22);%0A        user.setSurname(%22Goncalves%22);%0A        user.setRole(UserRole.ADMIN);%0A%0A        User userCreated = clientForUser.create(user);%0A        TestUtil.checkObjectIsNotNull(%22user%22, userCreated);%0A        TestUtil.checkField(%22Name%22, %22Antonio%22, userCreated.getName());%0A        TestUtil.checkField(%22Surname%22, %22Goncalves%22, userCreated.getSurname());%0A    %7D%0A
 %7D%0A

Add Test for user creation