/*
 * Arrebol Consultancy copyright.
 * 
 * This code belongs to Arrebol Consultancy
 * its use, redistribution or modification are prohibited 
 * without written authorization from Arrebol Consultancy.
 */
package com.arrebol.apc.controller.system.user;

import com.arrebol.apc.model.core.Permission;
import com.arrebol.apc.model.core.UserByOffice;
import com.arrebol.apc.model.enums.UserStatus;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;

/**
 *
 * @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
 */
public class UserUpdateControllerTest {

    private UserUpdateController controller;
    private final String OWNER_ID = "0dc7c246-7db8-11ea-9b1f-500320958bf8";
    private final String BALAM_UBO_ID = "caee5744-017b-4d1b-83f4-9087631cce4a";
    private final String BALAM_HR_ID = "9dc91af3-8c95-4234-b188-4e193e04e6bc";
    private final String YUNUEN_UBO_ID = "e9b4d118-da8a-48ac-aac8-50327294be71";
    private final String YUNUEN_HR_ID = "6ec0f133-bb05-4be9-ab9d-ec7b89d344ac";
    private final String OFFICE_ID = "caef3a64-7d1f-11ea-af3e-28f659da398e";
    private final boolean IS_ROUTE = true;
    private final boolean IN = false;

    @Before
    public void init() {
        controller = new UserUpdateController();
    }

    @Test
    public void findUsersInOfficeInStatuses() {
        try {
            List<UserStatus> statuses = new ArrayList<>();

            statuses.add(UserStatus.ENEBLED);
            controller.findUsersInOfficeInStatuses(statuses, OFFICE_ID, OWNER_ID);
        } catch (Exception e) {
            assertFalse(true);
        }
    }

    @Test
    public void findList() {
        try {
            List result = controller.findList(IS_ROUTE, IN, BALAM_UBO_ID, BALAM_HR_ID, OFFICE_ID);

            System.out.println("Size of the list: " + result.size());
            result.forEach(System.out::println);
            assertFalse(result.isEmpty());
        } catch (Exception e) {
            assertFalse(true);
        }
    }
}
