use of io.zeebe.exporter.proto.Schema.JobRecord in project zeebe-exporter-protobuf by camunda-community-hub.
the class RecordTransformTest method shouldTransformJob.
@Test
public void shouldTransformJob() {
// given
final JobRecordValue jobRecordValue = mockJobRecordValue();
final Record<JobRecordValue> mockedRecord = mockRecord(jobRecordValue, ValueType.JOB, JobIntent.CREATED);
// when
final Schema.JobRecord jobRecord = (Schema.JobRecord) RecordTransformer.toProtobufMessage(mockedRecord);
// then
assertMetadata(jobRecord.getMetadata(), "JOB", "CREATED");
assertJobRecord(jobRecord);
}
use of io.zeebe.exporter.proto.Schema.JobRecord in project zeebe-exporter-protobuf by camunda-community-hub.
the class RecordTransformTest method shouldTransformJobBatch.
@Test
public void shouldTransformJobBatch() {
// given
final JobBatchRecordValue jobBatchRecordValue = mockJobBatchRecordValue();
final Record<JobBatchRecordValue> mockedRecord = mockRecord(jobBatchRecordValue, ValueType.JOB_BATCH, JobBatchIntent.ACTIVATED);
// when
final Schema.JobBatchRecord jobBatchRecord = (Schema.JobBatchRecord) RecordTransformer.toProtobufMessage(mockedRecord);
// then
assertMetadata(jobBatchRecord.getMetadata(), "JOB_BATCH", "ACTIVATED");
assertThat(jobBatchRecord.getJobKeysList()).containsExactly(5L);
assertThat(jobBatchRecord.getMaxJobsToActivate()).isEqualTo(1);
assertThat(jobBatchRecord.getTimeout()).isEqualTo(1_000L);
assertThat(jobBatchRecord.getType()).isEqualTo("jobType");
assertThat(jobBatchRecord.getWorker()).isEqualTo("myveryownworker");
assertThat(jobBatchRecord.getTruncated()).isTrue();
assertThat(jobBatchRecord.getJobsList()).hasSize(1);
final JobRecord jobRecord = jobBatchRecord.getJobsList().get(0);
assertJobRecord(jobRecord);
}
Aggregations