use of com.redhat.service.smartevents.infra.models.dto.ProcessorDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ShardBridgesSyncAPITest method updateProcessorStatus.
@Test
@TestSecurity(user = DEFAULT_CUSTOMER_ID)
public void updateProcessorStatus() {
BridgeResponse bridgeResponse = TestUtils.createBridge(new BridgeRequest(DEFAULT_BRIDGE_NAME)).as(BridgeResponse.class);
BridgeDTO bridge = new BridgeDTO(bridgeResponse.getId(), bridgeResponse.getName(), TEST_BRIDGE_ENDPOINT, DEFAULT_CUSTOMER_ID, DEFAULT_USER_NAME, READY, new KafkaConnectionDTO());
TestUtils.updateBridge(bridge);
TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest(DEFAULT_PROCESSOR_NAME, TestUtils.createKafkaAction()));
final List<ProcessorDTO> processors = new ArrayList<>();
await().atMost(5, SECONDS).untilAsserted(() -> {
processors.clear();
processors.addAll(TestUtils.getProcessorsToDeployOrDelete().as(new TypeRef<List<ProcessorDTO>>() {
}));
assertThat(processors.size()).isEqualTo(1);
});
ProcessorDTO processor = processors.get(0);
processor.setStatus(READY);
TestUtils.updateProcessor(processor);
await().atMost(5, SECONDS).untilAsserted(() -> {
processors.clear();
processors.addAll(TestUtils.getProcessorsToDeployOrDelete().as(new TypeRef<List<ProcessorDTO>>() {
}));
assertThat(processors).isEmpty();
});
}
use of com.redhat.service.smartevents.infra.models.dto.ProcessorDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KafkaTopicActionInvokerBuilderTest method getActionInvoker_requestedTopicDoesNotExist.
@Test
void getActionInvoker_requestedTopicDoesNotExist() {
ProcessorDTO p = createProcessorWithActionForTopic("thisTopicDoesNotExist");
assertThatExceptionOfType(GatewayProviderException.class).isThrownBy(() -> builder.build(p, p.getDefinition().getResolvedAction()));
verify(kafkaAdmin).listTopics();
}
use of com.redhat.service.smartevents.infra.models.dto.ProcessorDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KafkaTopicActionInvokerBuilderTest method getActionInvoker.
@Test
void getActionInvoker() {
ProcessorDTO p = createProcessorWithActionForTopic(TOPIC_NAME);
ActionInvoker actionInvoker = builder.build(p, p.getDefinition().getResolvedAction());
assertThat(actionInvoker).isNotNull();
verify(kafkaAdmin).listTopics();
}
Aggregations