Search in sources :

Example 31 with Bridge

use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ConnectorsDAOTest method findByProcessorIdName.

@Test
public void findByProcessorIdName() {
    Bridge b = createBridge();
    Processor p = createProcessor(b, "foo");
    ConnectorEntity c = createPersistConnector(p, "connector", ManagedResourceStatus.READY);
    assertThat(connectorsDAO.findByProcessorIdAndName(p.getId(), c.getName())).isEqualTo(c);
}
Also used : Processor(com.redhat.service.bridge.manager.models.Processor) ConnectorEntity(com.redhat.service.bridge.manager.models.ConnectorEntity) Bridge(com.redhat.service.bridge.manager.models.Bridge) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 32 with Bridge

use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ConnectorsDAOTest method createBridge.

private Bridge createBridge() {
    Bridge b = new Bridge();
    b.setName(TestConstants.DEFAULT_BRIDGE_NAME);
    b.setCustomerId(TestConstants.DEFAULT_CUSTOMER_ID);
    b.setStatus(ManagedResourceStatus.READY);
    b.setSubmittedAt(ZonedDateTime.now());
    b.setPublishedAt(ZonedDateTime.now());
    bridgeDAO.persist(b);
    return b;
}
Also used : Bridge(com.redhat.service.bridge.manager.models.Bridge)

Example 33 with Bridge

use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ProcessorDAOTest method findByIdBridgeIdAndCustomerId.

@Test
public void findByIdBridgeIdAndCustomerId() {
    Bridge b = createBridge();
    Processor p = createProcessor(b, "foo");
    Processor found = processorDAO.findByIdBridgeIdAndCustomerId(p.getId(), b.getId(), b.getCustomerId());
    assertThat(found).isNotNull();
    assertThat(found.getId()).isEqualTo(p.getId());
}
Also used : Processor(com.redhat.service.bridge.manager.models.Processor) Bridge(com.redhat.service.bridge.manager.models.Bridge) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 34 with Bridge

use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ProcessorDAOTest method createBridge.

private Bridge createBridge() {
    Bridge b = new Bridge();
    b.setName(TestConstants.DEFAULT_BRIDGE_NAME);
    b.setCustomerId(TestConstants.DEFAULT_CUSTOMER_ID);
    b.setStatus(ManagedResourceStatus.READY);
    b.setSubmittedAt(ZonedDateTime.now());
    b.setPublishedAt(ZonedDateTime.now());
    b.setShardId(TestConstants.SHARD_ID);
    bridgeDAO.persist(b);
    return b;
}
Also used : Bridge(com.redhat.service.bridge.manager.models.Bridge)

Example 35 with Bridge

use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ProcessorDAOTest method findByBridgeIdAndName.

@Test
public void findByBridgeIdAndName() {
    Bridge b = createBridge();
    Processor p = createProcessor(b, "foo");
    Processor byBridgeIdAndName = processorDAO.findByBridgeIdAndName(b.getId(), p.getName());
    assertThat(byBridgeIdAndName).isNotNull();
    assertThat(byBridgeIdAndName.getName()).isEqualTo(p.getName());
    assertThat(byBridgeIdAndName.getBridge().getId()).isEqualTo(b.getId());
}
Also used : Processor(com.redhat.service.bridge.manager.models.Processor) Bridge(com.redhat.service.bridge.manager.models.Bridge) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Aggregations

Bridge (com.redhat.service.bridge.manager.models.Bridge)60 QuarkusTest (io.quarkus.test.junit.QuarkusTest)46 Test (org.junit.jupiter.api.Test)46 Processor (com.redhat.service.bridge.manager.models.Processor)34 ProcessorRequest (com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest)15 QueryInfo (com.redhat.service.bridge.infra.models.QueryInfo)11 Transactional (javax.transaction.Transactional)8 BridgeRequest (com.redhat.service.bridge.manager.api.models.requests.BridgeRequest)7 ItemNotFoundException (com.redhat.service.bridge.infra.exceptions.definitions.user.ItemNotFoundException)6 BaseAction (com.redhat.service.bridge.infra.models.actions.BaseAction)6 ConnectorEntity (com.redhat.service.bridge.manager.models.ConnectorEntity)6 Connector (com.openshift.cloud.api.connector.models.Connector)5 ConnectorStatusStatus (com.openshift.cloud.api.connector.models.ConnectorStatusStatus)4 InternalPlatformException (com.redhat.service.bridge.infra.exceptions.definitions.platform.InternalPlatformException)4 AlreadyExistingItemException (com.redhat.service.bridge.infra.exceptions.definitions.user.AlreadyExistingItemException)3 ProcessorDefinition (com.redhat.service.bridge.infra.models.processors.ProcessorDefinition)3 ConnectorRequest (com.openshift.cloud.api.connector.models.ConnectorRequest)2 BridgeLifecycleException (com.redhat.service.bridge.infra.exceptions.definitions.user.BridgeLifecycleException)2 BaseFilter (com.redhat.service.bridge.infra.models.filters.BaseFilter)2 ZonedDateTime (java.time.ZonedDateTime)2