use of org.folio.rest.jaxrs.model.Snapshot in project mod-source-record-storage by folio-org.
the class AbstractPostProcessingEventHandlerTest method setUp.
@Before
public void setUp(TestContext context) {
MockitoAnnotations.initMocks(this);
WireMock.stubFor(get(new UrlPathPattern(new RegexPattern(MAPPING_METADATA__URL + "/.*"), true)).willReturn(WireMock.ok().withBody(Json.encode(new MappingMetadataDto().withMappingParams(Json.encode(new MappingParameters()))))));
mappingParametersCache = new MappingParametersSnapshotCache(vertx);
recordDao = new RecordDaoImpl(postgresClientFactory);
handler = createHandler(recordDao, kafkaConfig);
Async async = context.async();
Snapshot snapshot1 = new Snapshot().withJobExecutionId(snapshotId1).withProcessingStartedDate(new Date()).withStatus(Snapshot.Status.COMMITTED);
Snapshot snapshot2 = new Snapshot().withJobExecutionId(snapshotId2).withProcessingStartedDate(new Date()).withStatus(Snapshot.Status.COMMITTED);
List<Snapshot> snapshots = new ArrayList<>();
snapshots.add(snapshot1);
snapshots.add(snapshot2);
this.record = new Record().withId(recordId).withMatchedId(recordId).withSnapshotId(snapshotId1).withGeneration(0).withRecordType(getMarcType()).withRawRecord(rawRecord).withParsedRecord(parsedRecord).withExternalIdsHolder(null);
SnapshotDaoUtil.save(postgresClientFactory.getQueryExecutor(TENANT_ID), snapshots).onComplete(save -> {
if (save.failed()) {
context.fail(save.cause());
}
async.complete();
});
}
Aggregations