use of com.redhat.service.bridge.manager.api.models.responses.BridgeResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesAPITest method getBridge.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void getBridge() {
Response bridgeCreateResponse = TestUtils.createBridge(new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME));
bridgeCreateResponse.then().statusCode(201);
BridgeResponse bridge = bridgeCreateResponse.as(BridgeResponse.class);
BridgeResponse retrievedBridge = TestUtils.getBridge(bridge.getId()).as(BridgeResponse.class);
assertThat(retrievedBridge).isNotNull();
assertThat(retrievedBridge.getId()).isEqualTo(bridge.getId());
assertThat(retrievedBridge.getName()).isEqualTo(bridge.getName());
assertThat(retrievedBridge.getEndpoint()).isEqualTo(bridge.getEndpoint());
}
use of com.redhat.service.bridge.manager.api.models.responses.BridgeResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesAPITest method testCreateAndGetBridge.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void testCreateAndGetBridge() {
TestUtils.createBridge(new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME)).then().statusCode(201);
BridgeListResponse bridgeListResponse = TestUtils.getBridges().as(BridgeListResponse.class);
assertThat(bridgeListResponse.getItems().size()).isEqualTo(1);
BridgeResponse bridgeResponse = bridgeListResponse.getItems().get(0);
assertThat(bridgeResponse.getName()).isEqualTo(TestConstants.DEFAULT_BRIDGE_NAME);
assertThat(bridgeResponse.getStatus()).isEqualTo(ManagedResourceStatus.ACCEPTED);
assertThat(bridgeResponse.getHref()).isEqualTo(APIConstants.USER_API_BASE_PATH + bridgeResponse.getId());
assertThat(bridgeResponse.getSubmittedAt()).isNotNull();
assertThat(bridgeResponse.getEndpoint()).isNull();
}
use of com.redhat.service.bridge.manager.api.models.responses.BridgeResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesAPITest method testDeleteBridge.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void testDeleteBridge() {
BridgeResponse response = TestUtils.createBridge(new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME)).as(BridgeResponse.class);
TestUtils.deleteBridge(response.getId()).then().statusCode(202);
response = TestUtils.getBridge(response.getId()).as(BridgeResponse.class);
assertThat(response.getStatus()).isEqualTo(ManagedResourceStatus.DEPROVISION);
}
use of com.redhat.service.bridge.manager.api.models.responses.BridgeResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method addProcessorToBridge_unrecognisedActionType.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void addProcessorToBridge_unrecognisedActionType() {
BridgeResponse bridgeResponse = createAndDeployBridge();
BaseAction action = createKafkaAction();
action.setType("thisDoesNotExist");
Set<BaseFilter> filters = Collections.singleton(new StringEquals("json.key", "value"));
Response response = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", filters, null, action));
assertThat(response.getStatusCode()).isEqualTo(400);
}
use of com.redhat.service.bridge.manager.api.models.responses.BridgeResponse 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);
}
Aggregations