Search in sources :

Example 6 with KafkaConnectionDTO

use of com.redhat.service.bridge.infra.models.dto.KafkaConnectionDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ShardBridgesSyncAPITest method updateProcessorStatus.

@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void updateProcessorStatus() {
    BridgeResponse bridgeResponse = TestUtils.createBridge(new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME)).as(BridgeResponse.class);
    BridgeDTO bridge = new BridgeDTO(bridgeResponse.getId(), bridgeResponse.getName(), TEST_BRIDGE_ENDPOINT, TestConstants.DEFAULT_CUSTOMER_ID, ManagedResourceStatus.READY, new KafkaConnectionDTO());
    TestUtils.updateBridge(bridge);
    TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest(TestConstants.DEFAULT_PROCESSOR_NAME, TestUtils.createKafkaAction()));
    List<ProcessorDTO> processors = TestUtils.getProcessorsToDeployOrDelete().as(new TypeRef<List<ProcessorDTO>>() {
    });
    ProcessorDTO processor = processors.get(0);
    processor.setStatus(ManagedResourceStatus.READY);
    TestUtils.updateProcessor(processor);
    processors = TestUtils.getProcessorsToDeployOrDelete().as(new TypeRef<List<ProcessorDTO>>() {
    });
    assertThat(processors.size()).isZero();
}
Also used : BridgeRequest(com.redhat.service.bridge.manager.api.models.requests.BridgeRequest) BridgeDTO(com.redhat.service.bridge.infra.models.dto.BridgeDTO) KafkaConnectionDTO(com.redhat.service.bridge.infra.models.dto.KafkaConnectionDTO) ProcessorDTO(com.redhat.service.bridge.infra.models.dto.ProcessorDTO) TypeRef(io.restassured.common.mapper.TypeRef) ProcessorRequest(com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest) List(java.util.List) BridgeResponse(com.redhat.service.bridge.manager.api.models.responses.BridgeResponse) TestSecurity(io.quarkus.test.security.TestSecurity) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 7 with KafkaConnectionDTO

use of com.redhat.service.bridge.infra.models.dto.KafkaConnectionDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class BridgesServiceImpl method toDTO.

@Override
public BridgeDTO toDTO(Bridge bridge) {
    KafkaConnectionDTO kafkaConnectionDTO = new KafkaConnectionDTO(internalKafkaConfigurationProvider.getBootstrapServers(), internalKafkaConfigurationProvider.getClientId(), internalKafkaConfigurationProvider.getClientSecret(), internalKafkaConfigurationProvider.getSecurityProtocol(), getBridgeTopicName(bridge));
    BridgeDTO dto = new BridgeDTO();
    dto.setId(bridge.getId());
    dto.setName(bridge.getName());
    dto.setEndpoint(bridge.getEndpoint());
    dto.setStatus(bridge.getStatus());
    dto.setCustomerId(bridge.getCustomerId());
    dto.setKafkaConnection(kafkaConnectionDTO);
    return dto;
}
Also used : BridgeDTO(com.redhat.service.bridge.infra.models.dto.BridgeDTO) KafkaConnectionDTO(com.redhat.service.bridge.infra.models.dto.KafkaConnectionDTO)

Aggregations

KafkaConnectionDTO (com.redhat.service.bridge.infra.models.dto.KafkaConnectionDTO)7 BridgeDTO (com.redhat.service.bridge.infra.models.dto.BridgeDTO)6 ProcessorDTO (com.redhat.service.bridge.infra.models.dto.ProcessorDTO)5 BridgeRequest (com.redhat.service.bridge.manager.api.models.requests.BridgeRequest)5 ProcessorRequest (com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest)5 BridgeResponse (com.redhat.service.bridge.manager.api.models.responses.BridgeResponse)5 QuarkusTest (io.quarkus.test.junit.QuarkusTest)5 TestSecurity (io.quarkus.test.security.TestSecurity)5 Test (org.junit.jupiter.api.Test)5 List (java.util.List)4 BaseFilter (com.redhat.service.bridge.infra.models.filters.BaseFilter)2 StringEquals (com.redhat.service.bridge.infra.models.filters.StringEquals)2 BaseAction (com.redhat.service.bridge.infra.models.actions.BaseAction)1 ProcessorDefinition (com.redhat.service.bridge.infra.models.processors.ProcessorDefinition)1 TypeRef (io.restassured.common.mapper.TypeRef)1 ResponseLoggingFilter (io.restassured.filter.log.ResponseLoggingFilter)1