use of com.github.database.rider.core.api.dataset.DataSet in project sda-dropwizard-commons by SDA-SE.
the class PersonManagerTest method testCreation.
@Test
// initialize database with data from yml file
@DataSet("datasets/base.yml")
@ExpectedDataSet({ "datasets/base.yml", "datasets/added.yml" })
public // assert that database reflects the given data
void testCreation() {
// NOSONAR the assertion is fulfilled by DBUnit with @ExpectedDataSet
PersonEntity person = new PersonEntity();
person.setName("Jasmin Doe");
daoTestRule.inTransaction(() -> personManager.persist(person));
}
use of com.github.database.rider.core.api.dataset.DataSet in project esocial by tst-labs.
the class LoteServicoTest method deveLimitarLotesACinquentaEventos.
@Test
@DataSet(executeScriptsBefore = "cleanup.sql")
public void deveLimitarLotesACinquentaEventos() {
List<EnvioEvento> listaEnvioEvento = gerarEnvioEvento(51);
List<Lote> lotes = loteServico.gerarLotes(listaEnvioEvento);
SoftAssertions soft = new SoftAssertions();
soft.assertThat(lotes).hasSize(2);
soft.assertThat(lotes.get(0).getEnviosEvento()).hasSize(50);
soft.assertThat(lotes.get(1).getEnviosEvento()).hasSize(1);
soft.assertAll();
}
use of com.github.database.rider.core.api.dataset.DataSet in project esocial by tst-labs.
the class OcorrenciaServicoTest method deveGerarEvento.
@Test
@DataSet(value = { "ocorrencia.yml" }, executeScriptsBefore = "cleanup.sql")
@Transactional
public void deveGerarEvento() throws Exception {
Ocorrencia ocorrencia = em.find(Ocorrencia.class, 1l);
assertThat(ocorrencia.getEvento()).isNull();
Ocorrencia ocorrenciaComEvento = servico.gerarEvento(ocorrencia);
assertThat(ocorrenciaComEvento.getEvento()).isNotNull();
}
use of com.github.database.rider.core.api.dataset.DataSet in project esocial by tst-labs.
the class OcorrenciaServicoTest method testeSalvarOcorrencia.
@Test
@DataSet(executeScriptsBefore = "cleanup.sql")
public void testeSalvarOcorrencia() {
Ocorrencia ocorrencia = getOcorrencia();
servico.salvar(ocorrencia);
Ocorrencia estOcorrencia = em.find(Ocorrencia.class, ocorrencia.getId());
assertThat(estOcorrencia.getReferencia()).isEqualTo(ocorrencia.getReferencia());
assertThat(estOcorrencia.getDadosOcorrencia()).isNotNull();
}
use of com.github.database.rider.core.api.dataset.DataSet in project esocial by tst-labs.
the class ProducaoRestritaServicoTest method deveGerarEventoParaLimparProducaoRestrita.
@Test
@DataSet(executeScriptsBefore = "cleanup.sql")
public void deveGerarEventoParaLimparProducaoRestrita() {
Evento evento = producaoRestritaServico.gerarEventoLimparProducaoRestrita(CNPJ);
SoftAssertions soft = new SoftAssertions();
soft.assertThat(evento.getIdEvento()).isNotNull();
soft.assertThat(evento.getTipoEvento()).isEqualTo(TipoEvento.INFORMACOES_EMPREGADOR);
soft.assertAll();
}
Aggregations