/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arrebol.taxiservicios.controller.login;

import com.arrebol.taxiservicios.model.core.User;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Picasso
 */
public class LoginControllerJUnitTest {

    private static final String USERNAME = "ruben.campos";

    private LoginController controller;

    public LoginControllerJUnitTest() {
    }

    @Before
    public void setUp() throws Exception {
        controller = new LoginController();
    }

    @Test
    public void loadUserSigned() {
        try {
            User user = controller.loadUserSigned(USERNAME);
            System.out.println(user.getPerson().getId());
            System.out.println(user.getPerson().getFirstName());
            System.out.println(user.getPerson().getLastName());

            assertNotNull(user.getPerson().getId());
            assertNotNull(user.getPerson().getFirstName());
            assertNotNull(user.getPerson().getLastName());
        } catch (Exception e) {
            assertFalse(true);
        }
    }
// condominio maguey #46, villas de san jose, tultitlan edo. mex, cp 54910.

    //@Test
    public void loadGrantsByUser() {
        try {
            List<String> grants = controller.loadGrantsByUser(USERNAME);

            assertNotEquals(0, grants.size());
        } catch (Exception e) {
            assertFalse(true);
        }
    }

}
