use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method testToResponse.
@Test
void testToResponse() {
Bridge b = Fixtures.createBridge();
Processor p = Fixtures.createProcessor(b, READY);
Action action = Fixtures.createKafkaAction();
ProcessorDefinition definition = new ProcessorDefinition(Collections.emptySet(), "", action);
p.setDefinition(definition);
ProcessorResponse r = processorService.toResponse(p);
assertThat(r).isNotNull();
assertThat(r.getHref()).isEqualTo(APIConstants.USER_API_BASE_PATH + b.getId() + "/processors/" + p.getId());
assertThat(r.getName()).isEqualTo(p.getName());
assertThat(r.getStatus()).isEqualTo(p.getStatus());
assertThat(r.getType()).isEqualTo(p.getType());
assertThat(r.getId()).isEqualTo(p.getId());
assertThat(r.getSubmittedAt()).isEqualTo(p.getSubmittedAt());
assertThat(r.getPublishedAt()).isEqualTo(p.getPublishedAt());
assertThat(r.getKind()).isEqualTo("Processor");
assertThat(r.getTransformationTemplate()).isEmpty();
assertThat(r.getAction().getType()).isEqualTo(KafkaTopicAction.TYPE);
}
Aggregations