/*
 * 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.taxiservicios.controller.system;

import com.arrebol.taxiservicios.model.core.SystemProperty;
import com.arrebol.taxiservicios.model.enums.SystemPropertyType;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import static org.junit.Assert.assertNotNull;
import org.junit.Before;
import org.junit.Test;

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

    private SystemPropertyController controller;

    public SystemPropertyControllerTest() {
    }

    @Before
    public void setUp() {
        controller = new SystemPropertyController();
    }

    @Test
    public void getAllSystemProperties() {
        try {
            List<SystemProperty> results = controller.getAllSystemProperties();

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

            Assert.assertFalse(results.isEmpty());
        } catch (Exception e) {
            assertNotNull(null);
        }
    }

    @Test
    public void updateSystemProperties() {
        try {
            List<SystemProperty> systemProperties = new ArrayList<>();

            systemProperties.add(
                    new SystemProperty(
                            "e52a16f6-c547-11eb-aa96-8cc84ba27d44",
                            SystemPropertyType.FEE,
                            "50")
            );

            Assert.assertTrue(controller.updateSystemProperties(systemProperties));
        } catch (Exception e) {
            assertNotNull(null);
        }
    }
}
