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

import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
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.model.Direcciones;
import com.ejie.ad74a.service.DireccionesService;

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

	@Autowired
	private DireccionesService direccionesService;

	@Test
	@Transactional(propagation = Propagation.REQUIRES_NEW)
	@Rollback(false)
	public void testPasarHistoricoDireccion() {

		Direcciones histDireccion = this.direccionesService.passAdressHistory(84L, 65L);

		assertTrue("No se ha recuperado el solicitante", histDireccion != null);
	}

}
