Search in sources :

Example 6 with ConnectorEntity

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

the class ConnectorsServiceTest method testConnectorEntity.

private ConnectorEntity testConnectorEntity() {
    ConnectorEntity connectorEntity = new ConnectorEntity();
    connectorEntity.setId(TEST_CONNECTOR_ID);
    connectorEntity.setConnectorExternalId(TEST_CONNECTOR_EXTERNAL_ID);
    connectorEntity.setProcessor(testProcessor());
    return connectorEntity;
}
Also used : ConnectorEntity(com.redhat.service.bridge.manager.models.ConnectorEntity)

Example 7 with ConnectorEntity

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

the class Fixtures method createConnector.

public static ConnectorEntity createConnector(Processor p, String connectorName, ManagedResourceStatus status, String topicName) {
    ConnectorEntity c = new ConnectorEntity();
    c.setName(connectorName);
    c.setProcessor(p);
    c.setStatus(status);
    c.setSubmittedAt(ZonedDateTime.now());
    c.setPublishedAt(ZonedDateTime.now());
    c.setDefinition(new TextNode("definition"));
    c.setTopicName(topicName);
    c.setConnectorExternalId("connectorExternalId");
    return c;
}
Also used : ConnectorEntity(com.redhat.service.bridge.manager.models.ConnectorEntity) TextNode(com.fasterxml.jackson.databind.node.TextNode)

Example 8 with ConnectorEntity

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

the class ConnectorsApiClientTest method testConnectorEntity.

private ConnectorEntity testConnectorEntity() {
    ConnectorEntity connectorEntity = new ConnectorEntity();
    connectorEntity.setId(TEST_CONNECTOR_ID);
    connectorEntity.setName(TEST_CONNECTOR_NAME);
    connectorEntity.setConnectorType(TEST_CONNECTOR_TYPE);
    connectorEntity.setConnectorExternalId(TEST_CONNECTOR_EXTERNAL_ID);
    connectorEntity.setProcessor(testProcessor());
    return connectorEntity;
}
Also used : ConnectorEntity(com.redhat.service.bridge.manager.models.ConnectorEntity)

Example 9 with ConnectorEntity

use of com.redhat.service.bridge.manager.models.ConnectorEntity 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 10 with ConnectorEntity

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

the class ConnectorsDAOTest method createPersistConnector.

private ConnectorEntity createPersistConnector(Processor p, String connectorName, ManagedResourceStatus status) {
    ConnectorEntity c = Fixtures.createConnector(p, connectorName, status, "topicName");
    connectorsDAO.persist(c);
    return c;
}
Also used : ConnectorEntity(com.redhat.service.bridge.manager.models.ConnectorEntity)

Aggregations

ConnectorEntity (com.redhat.service.bridge.manager.models.ConnectorEntity)17 Processor (com.redhat.service.bridge.manager.models.Processor)9 Connector (com.openshift.cloud.api.connector.models.Connector)6 ConnectorStatusStatus (com.openshift.cloud.api.connector.models.ConnectorStatusStatus)6 Bridge (com.redhat.service.bridge.manager.models.Bridge)6 QuarkusTest (io.quarkus.test.junit.QuarkusTest)6 Test (org.junit.jupiter.api.Test)6 Work (com.redhat.service.bridge.manager.models.Work)5 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 ZonedDateTime (java.time.ZonedDateTime)3 InternalPlatformException (com.redhat.service.bridge.infra.exceptions.definitions.platform.InternalPlatformException)2 Transactional (javax.transaction.Transactional)2 EnumSource (org.junit.jupiter.params.provider.EnumSource)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 TextNode (com.fasterxml.jackson.databind.node.TextNode)1 ConnectorRequest (com.openshift.cloud.api.connector.models.ConnectorRequest)1 Topic (com.openshift.cloud.api.kas.auth.models.Topic)1 BaseAction (com.redhat.service.bridge.infra.models.actions.BaseAction)1 ConnectorAction (com.redhat.service.bridge.manager.actions.connectors.ConnectorAction)1