use of com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method addProcessorWithNullFiltersToBridge.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void addProcessorWithNullFiltersToBridge() {
BridgeResponse bridgeResponse = createAndDeployBridge();
Response response = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", TestUtils.createKafkaAction()));
assertThat(response.getStatusCode()).isEqualTo(202);
ProcessorResponse processorResponse = response.as(ProcessorResponse.class);
assertThat(processorResponse.getName()).isEqualTo("myProcessor");
assertThat(processorResponse.getFilters()).isNull();
assertThat(processorResponse.getTransformationTemplate()).isNull();
assertRequestedAction(processorResponse);
}
use of com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method getProcessor_processorDoesNotExist.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void getProcessor_processorDoesNotExist() {
BridgeResponse bridgeResponse = createAndDeployBridge();
Response response = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", TestUtils.createKafkaAction()));
assertThat(response.getStatusCode()).isEqualTo(202);
Response found = TestUtils.getProcessor(bridgeResponse.getId(), "doesNotExist");
assertThat(found.getStatusCode()).isEqualTo(404);
}
use of com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method addProcessorWithEmptyChannelParameterToBridge.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void addProcessorWithEmptyChannelParameterToBridge() {
BridgeResponse bridgeResponse = createAndDeployBridge();
Action action = TestUtils.createKafkaAction();
action.setType(SlackAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(SlackAction.CHANNEL_PARAM, "");
params.put(SlackAction.WEBHOOK_URL_PARAM, "https://example.com");
action.setMapParameters(params);
Response response = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", null, null, action));
assertThat(response.getStatusCode()).isEqualTo(202);
}
Aggregations