/*
 * 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.notification;

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

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

    private NotificationController controller;
    private static final String USER_NAME_DIRECCION = "09ea84b8-b9d1-4a71-adfe-db653b2a9982";

    public NotificationControllerTest() {
    }

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

    //@Test
    public void findTotalNotification() {
        try {
            int total = controller.countNotificationByUserId(USER_NAME_DIRECCION);

            assertEquals(total, 0);
        } catch (Exception e) {
            assertFalse(true);
        }
    }

    //@Test
    public void findNotificationDetailsByUserId() {
        try {
            List<ServiceOrderNotification> notifications = controller.findNotificationDetailsByUserId(USER_NAME_DIRECCION, DeliveryStatusType.ENABLED);

            notifications.forEach(System.out::println);

            assertFalse(notifications.isEmpty());
        } catch (Exception e) {
            assertFalse(true);
        }
    }

    //@Test
    public void isActiveNotificationByUser() {
        try {
            assertTrue(controller.isActiveNotificationByUser(USER_NAME_DIRECCION));
        } catch (Exception e) {
            assertFalse(true);
        }
    }

    //@Test
    public void findNotificationUsers() {
        try {
            List<User> users = controller.findNotificationUsers(false);

            users.forEach(System.out::println);

            assertNotNull(users);
        } catch (Exception e) {
            assertFalse(true);
        }
    }

}
