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

import static com.arrebol.apc.ws.cash.CashRegisterWSTest.USER_ID;
import java.net.URI;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.glassfish.jersey.test.TestProperties;
import org.glassfish.jersey.test.util.runner.ConcurrentRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
 *
 * @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
 */
@RunWith(ConcurrentRunner.class)
public class UserWSTest extends JerseyTest {

    private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource");
    public final static String TEPIC_OFFICE = "caef3a64-7d1f-11ea-af3e-28f659da398e";

    @Override
    protected ResourceConfig configure() {
        enable(TestProperties.LOG_TRAFFIC);
        return new ResourceConfig(UserWS.class);
    }

    @Test
    public void findAllLoanByUserOrderPreference() {
        Response response = target().path("users/list-by-office")
                .queryParam("office", TEPIC_OFFICE)
                .request(MediaType.APPLICATION_JSON)
                .get(Response.class);

        System.out.println("response: " + response);
        assertEquals(200, response.getStatus());
    }
}
