Search in sources :

Example 1 with DataSet

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));
}
Also used : PersonEntity(org.sdase.commons.server.hibernate.example.db.model.PersonEntity) Test(org.junit.Test) PersonManagerTest(org.sdase.commons.server.hibernate.example.test.PersonManagerTest) DataSet(com.github.database.rider.core.api.dataset.DataSet) ExpectedDataSet(com.github.database.rider.core.api.dataset.ExpectedDataSet) ExpectedDataSet(com.github.database.rider.core.api.dataset.ExpectedDataSet)

Example 2 with DataSet

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();
}
Also used : Lote(br.jus.tst.esocialjt.dominio.Lote) EnvioEvento(br.jus.tst.esocialjt.dominio.EnvioEvento) SoftAssertions(org.assertj.core.api.SoftAssertions) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DataSet(com.github.database.rider.core.api.dataset.DataSet)

Example 3 with DataSet

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();
}
Also used : Ocorrencia(br.jus.tst.esocialjt.dominio.Ocorrencia) TipoOcorrencia(br.jus.tst.esocial.ocorrencia.TipoOcorrencia) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DataSet(com.github.database.rider.core.api.dataset.DataSet) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with DataSet

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();
}
Also used : Ocorrencia(br.jus.tst.esocialjt.dominio.Ocorrencia) TipoOcorrencia(br.jus.tst.esocial.ocorrencia.TipoOcorrencia) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DataSet(com.github.database.rider.core.api.dataset.DataSet)

Example 5 with DataSet

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();
}
Also used : SoftAssertions(org.assertj.core.api.SoftAssertions) Evento(br.jus.tst.esocialjt.dominio.Evento) TipoEvento(br.jus.tst.esocialjt.dominio.TipoEvento) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DataSet(com.github.database.rider.core.api.dataset.DataSet)

Aggregations

DataSet (com.github.database.rider.core.api.dataset.DataSet)354 Test (org.junit.Test)204 ExpectedDataSet (com.github.database.rider.core.api.dataset.ExpectedDataSet)164 Test (org.junit.jupiter.api.Test)118 User (com.github.database.rider.core.model.User)88 AbstractIntegrationTest (dev.iakunin.codexiabot.AbstractIntegrationTest)61 WireMockWrapper (dev.iakunin.codexiabot.util.WireMockWrapper)60 Stub (dev.iakunin.codexiabot.util.wiremock.Stub)60 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)48 IDataSet (org.dbunit.dataset.IDataSet)47 Response (dev.iakunin.codexiabot.util.wiremock.Response)43 Request (dev.iakunin.codexiabot.util.wiremock.Request)39 ResourceOf (org.cactoos.io.ResourceOf)38 User (com.github.database.rider.cdi.model.User)37 Tweet (com.github.database.rider.core.model.Tweet)37 User (com.github.database.rider.junit5.model.User)29 Follower (com.github.database.rider.core.model.Follower)25 QuarkusTest (io.quarkus.test.junit.QuarkusTest)18 SoftAssertions (org.assertj.core.api.SoftAssertions)16 Book (com.github.quarkus.sample.domain.Book)15