Blame |
Last modification |
View Log
| Download
| RSS feed
package br.gov.al.saude.scs.core.application;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JMock;
import org.jmock.integration.junit4.JUnit4Mockery;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import br.gov.al.saude.scs.core.application.uf.UfFacade;
import br.gov.al.saude.scs.core.application.uf.impl.UfFacadeImpl;
import br.gov.al.saude.scs.core.domain.uf.UfService;
@RunWith(JMock.class)
public class UfFacadeImplTest {
private UfFacade ufFacade;
private UfService ufServiceMock;
private Mockery contexto;
@Before
public void inicializarContexto() {
contexto = new JUnit4Mockery();
ufServiceMock = getContexto().mock(UfService.class);
ufFacade = new UfFacadeImpl(ufServiceMock);
}
@Test
public void aoListarUfsDeveriaDelegarParaOhService(){
getContexto().checking(new Expectations(){{
oneOf(ufServiceMock).listar();
}});
ufFacade.listar();
}
public Mockery getContexto() {
return contexto;
}
}