Search in sources :

Example 1 with JobExecutionSourceChunkDao

use of org.folio.dao.JobExecutionSourceChunkDao in project mod-source-record-manager by folio-org.

the class RawMarcChunkConsumersVerticleTest method shouldNotSendAnyEventsForDuplicates.

@Test
public void shouldNotSendAnyEventsForDuplicates() throws InterruptedException {
    // given
    RawRecordsDto chunk = getChunk(RecordsMetadata.ContentType.MARC_RAW, RAW_RECORD_WITH_999_ff_field);
    JobExecutionSourceChunkDao jobExecutionSourceChunkDao = getBeanFromSpringContext(vertx, org.folio.dao.JobExecutionSourceChunkDao.class);
    jobExecutionSourceChunkDao.save(new JobExecutionSourceChunk().withId(chunk.getId()).withState(JobExecutionSourceChunk.State.IN_PROGRESS), TENANT_ID);
    SendKeyValues<String, String> request = prepareWithSpecifiedEventPayload(JobProfileInfo.DataType.MARC, Json.encode(chunk));
    String jobExecutionId = getJobExecutionId(request);
    // when
    kafkaCluster.send(request);
    // then
    checkEventWithTypeWasNotSend(jobExecutionId, DI_RAW_RECORDS_CHUNK_PARSED);
    checkEventWithTypeWasNotSend(jobExecutionId, DI_ERROR);
}
Also used : JobExecutionSourceChunkDao(org.folio.dao.JobExecutionSourceChunkDao) RawRecordsDto(org.folio.rest.jaxrs.model.RawRecordsDto) JobExecutionSourceChunk(org.folio.rest.jaxrs.model.JobExecutionSourceChunk) AbstractRestTest(org.folio.rest.impl.AbstractRestTest) Test(org.junit.Test)

Aggregations

JobExecutionSourceChunkDao (org.folio.dao.JobExecutionSourceChunkDao)1 AbstractRestTest (org.folio.rest.impl.AbstractRestTest)1 JobExecutionSourceChunk (org.folio.rest.jaxrs.model.JobExecutionSourceChunk)1 RawRecordsDto (org.folio.rest.jaxrs.model.RawRecordsDto)1 Test (org.junit.Test)1