use of com.redhat.service.bridge.infra.models.dto.ProcessorDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ShardBridgesSyncAPITest method testUnouthorizedRole.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void testUnouthorizedRole() {
reset(jwt);
when(jwt.getClaim(APIConstants.SUBJECT_ATTRIBUTE_CLAIM)).thenReturn("hacker");
TestUtils.getBridgesToDeployOrDelete().then().statusCode(403);
TestUtils.getProcessorsToDeployOrDelete().then().statusCode(403);
TestUtils.updateBridge(new BridgeDTO()).then().statusCode(403);
TestUtils.updateProcessor(new ProcessorDTO()).then().statusCode(403);
}
use of com.redhat.service.bridge.infra.models.dto.ProcessorDTO 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();
}
use of com.redhat.service.bridge.infra.models.dto.ProcessorDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeExecutorController method notifyManager.
private void notifyManager(BridgeExecutor bridgeExecutor, ManagedResourceStatus status) {
ProcessorDTO dto = bridgeExecutor.toDTO();
dto.setStatus(status);
managerSyncService.notifyProcessorStatusChange(dto).subscribe().with(success -> LOGGER.info("Updating Processor with id '{}' done", dto.getId()), failure -> LOGGER.error("Updating Processor with id '{}' FAILED", dto.getId()));
}
use of com.redhat.service.bridge.infra.models.dto.ProcessorDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KafkaTopicActionTest method getActionInvoker_requestedTopicDoesNotExist.
@Test
public void getActionInvoker_requestedTopicDoesNotExist() {
ProcessorDTO p = createProcessorWithActionForTopic("thisTopicDoesNotExist");
assertThatExceptionOfType(ActionProviderException.class).isThrownBy(() -> kafkaTopicAction.getActionInvoker(p, p.getDefinition().getResolvedAction()));
verify(kafkaAdmin).listTopics();
}
use of com.redhat.service.bridge.infra.models.dto.ProcessorDTO in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KafkaTopicActionTest method getActionInvoker.
@Test
public void getActionInvoker() {
ProcessorDTO p = createProcessorWithActionForTopic(TOPIC_NAME);
ActionInvoker actionInvoker = kafkaTopicAction.getActionInvoker(p, p.getDefinition().getResolvedAction());
assertThat(actionInvoker).isNotNull();
verify(kafkaAdmin).listTopics();
}
Aggregations