use of com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method addProcessorToBridgeAndRetrieve.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void addProcessorToBridgeAndRetrieve() {
BridgeResponse bridgeResponse = createAndDeployBridge();
Set<BaseFilter> filters = Collections.singleton(new StringEquals("json.key", "value"));
Response response = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", filters, null, createKafkaAction()));
assertThat(response.getStatusCode()).isEqualTo(201);
ProcessorResponse retrieved = TestUtils.getProcessor(bridgeResponse.getId(), response.as(ProcessorResponse.class).getId()).as(ProcessorResponse.class);
assertThat(retrieved.getName()).isEqualTo("myProcessor");
assertThat(retrieved.getFilters().size()).isEqualTo(1);
assertThat(retrieved.getTransformationTemplate()).isNull();
assertRequestedAction(retrieved);
}
use of com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method testDeleteProcessor.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void testDeleteProcessor() {
BridgeResponse bridgeResponse = createAndDeployBridge();
ProcessorResponse processorResponse = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", null, null, createKafkaAction())).as(ProcessorResponse.class);
TestUtils.deleteProcessor(bridgeResponse.getId(), processorResponse.getId()).then().statusCode(202);
processorResponse = TestUtils.getProcessor(bridgeResponse.getId(), processorResponse.getId()).as(ProcessorResponse.class);
assertThat(processorResponse.getStatus()).isEqualTo(ManagedResourceStatus.DEPROVISION);
}
use of com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method getProcessorWithSendToBridgeAction.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void getProcessorWithSendToBridgeAction() {
BridgeResponse bridgeResponse = createAndDeployBridge();
String bridgeId = bridgeResponse.getId();
Response response = TestUtils.addProcessorToBridge(bridgeId, new ProcessorRequest("myProcessor", createSendToBridgeAction(bridgeId)));
assertThat(response.getStatusCode()).isEqualTo(201);
ProcessorResponse pr = response.as(ProcessorResponse.class);
assertThat(pr.getAction().getType()).isEqualTo(SendToBridgeAction.TYPE);
assertThat(pr.getAction().getParameters()).containsEntry(SendToBridgeAction.BRIDGE_ID_PARAM, bridgeId);
ProcessorResponse found = TestUtils.getProcessor(bridgeId, pr.getId()).as(ProcessorResponse.class);
assertThat(found.getId()).isEqualTo(pr.getId());
assertThat(found.getAction().getType()).isEqualTo(SendToBridgeAction.TYPE);
assertThat(found.getAction().getParameters()).containsEntry(SendToBridgeAction.BRIDGE_ID_PARAM, bridgeId);
}
use of com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method getProcessor_bridgeDoesNotExist.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void getProcessor_bridgeDoesNotExist() {
BridgeResponse bridgeResponse = createAndDeployBridge();
ProcessorResponse response = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", createKafkaAction())).as(ProcessorResponse.class);
Response found = TestUtils.getProcessor("doesNotExist", response.getId());
assertThat(found.getStatusCode()).isEqualTo(404);
}
use of com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ActionParamValidatorContainerTest method buildTestRequest.
private ProcessorRequest buildTestRequest() {
ProcessorRequest p = new ProcessorRequest();
BaseAction b = new BaseAction();
b.setType(TEST_ACTION_TYPE);
Map<String, String> params = new HashMap<>();
params.put(TEST_PARAM_NAME, TEST_PARAM_VALUE);
b.setParameters(params);
p.setAction(b);
return p;
}
Aggregations