use of com.redhat.service.bridge.infra.models.QueryInfo in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method testMGDOBR_80.
@Test
public void testMGDOBR_80() {
Bridge b = createPersistBridge(ManagedResourceStatus.READY);
Set<BaseFilter> filters = new HashSet<>();
filters.add(new StringEquals("name", "myName"));
filters.add(new StringEquals("surename", "mySurename"));
ProcessorRequest r = new ProcessorRequest("My Processor", filters, null, createKafkaAction());
Processor processor = processorService.createProcessor(b.getId(), b.getCustomerId(), r);
await().atMost(5, SECONDS).untilAsserted(() -> {
Processor p = processorDAO.findById(processor.getId());
assertThat(p).isNotNull();
assertThat(p.getDependencyStatus()).isEqualTo(ManagedResourceStatus.READY);
});
assertThat(processorService.getProcessors(b.getId(), TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(0, 100)).getSize()).isEqualTo(1);
}
use of com.redhat.service.bridge.infra.models.QueryInfo in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method getProcessors_noProcessorsOnBridge.
@Test
public void getProcessors_noProcessorsOnBridge() {
Bridge b = createPersistBridge(ManagedResourceStatus.READY);
ListResult<Processor> results = processorService.getProcessors(b.getId(), TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(0, 100));
assertThat(results.getPage()).isZero();
assertThat(results.getSize()).isZero();
assertThat(results.getTotal()).isZero();
}
use of com.redhat.service.bridge.infra.models.QueryInfo in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method getProcessors.
@Test
public void getProcessors() {
Bridge b = createPersistBridge(ManagedResourceStatus.READY);
ProcessorRequest r = new ProcessorRequest("My Processor", createKafkaAction());
Processor processor = processorService.createProcessor(b.getId(), b.getCustomerId(), r);
await().atMost(5, SECONDS).untilAsserted(() -> {
Processor p = processorDAO.findById(processor.getId());
assertThat(p).isNotNull();
assertThat(p.getDependencyStatus()).isEqualTo(ManagedResourceStatus.READY);
});
ListResult<Processor> results = processorService.getProcessors(b.getId(), TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(0, 100));
assertThat(results.getPage()).isZero();
assertThat(results.getSize()).isEqualTo(1L);
assertThat(results.getTotal()).isEqualTo(1L);
assertThat(results.getItems().get(0).getId()).isEqualTo(processor.getId());
}
use of com.redhat.service.bridge.infra.models.QueryInfo in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeDAOTest method testListByCustomerId.
@Test
public void testListByCustomerId() {
Bridge firstBridge = buildBridge(TestConstants.DEFAULT_BRIDGE_ID, TestConstants.DEFAULT_BRIDGE_NAME);
bridgeDAO.persist(firstBridge);
Bridge secondBridge = buildBridge("mySecondBridgeId", "mySecondBridgeName");
bridgeDAO.persist(secondBridge);
ListResult<Bridge> retrievedBridges = bridgeDAO.findByCustomerId(TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(TestConstants.DEFAULT_PAGE, TestConstants.DEFAULT_PAGE_SIZE));
assertThat(retrievedBridges).isNotNull();
assertThat(retrievedBridges.getSize()).isEqualTo(2);
assertThat(retrievedBridges.getTotal()).isEqualTo(2);
assertThat(retrievedBridges.getPage()).isZero();
// Newest istances come first
assertThat(retrievedBridges.getItems().get(1).getId()).isEqualTo(firstBridge.getId());
assertThat(retrievedBridges.getItems().get(0).getId()).isEqualTo(secondBridge.getId());
}
use of com.redhat.service.bridge.infra.models.QueryInfo in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method findByBridgeIdAndCustomerId_noProcessors.
@Test
public void findByBridgeIdAndCustomerId_noProcessors() {
Bridge b = createBridge();
ListResult<Processor> listResult = processorDAO.findByBridgeIdAndCustomerId(b.getId(), TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(0, 100));
assertThat(listResult.getPage()).isZero();
assertThat(listResult.getSize()).isZero();
assertThat(listResult.getTotal()).isZero();
}
Aggregations