package com.ejie.ad74a.service.test.basic;

import static org.junit.Assert.assertTrue;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ejie.ad74a.dao.SolicitantesDao;
import com.ejie.ad74a.model.Direcciones;
import com.ejie.ad74a.model.Solicitantes;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:test/application-context.xml")
public class TestSolicitanteService {

	@Autowired
	private SolicitantesDao solicitanteDao;

	@Test
	@Transactional(propagation = Propagation.REQUIRES_NEW)
	// @Rollback(true)
	public void testFindSolicitante() {
		Direcciones direccion = new Direcciones();
		direccion.setIdCalle06(130105900006420L);
		direccion.setIdPortal06(80105900145140L);
		direccion.setPiso06("9");
		direccion.setLetra06("f");
		List<Solicitantes> listsolicitante = this.solicitanteDao.findSameDirectionBenefActivo(direccion, "11111111H",
				"666555444", null);

		assertTrue("No se ha encontrado", listsolicitante != null);
	}

}
