use of com.redhat.service.smartevents.infra.models.dto.KafkaConnectionDTO 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();
});
}
Aggregations