Search in sources :

Example 1 with QueryHelper

use of org.folio.rest.persist.PostgresClient.QueryHelper in project raml-module-builder by folio-org.

the class PostgresClientIT method streamGetResultException.

@Test
public void streamGetResultException(TestContext context) {
    createTableWithPoLines(context);
    ResultInfo resultInfo = new ResultInfo();
    context.assertNotNull(vertx);
    RowStream<Row> sqlRowStream = new MySQLRowStream();
    StringBuilder events = new StringBuilder();
    Async async = context.async();
    PostgresClientStreamResult<Object> streamResult = new PostgresClientStreamResult(resultInfo);
    Transaction transaction = null;
    postgresClient.doStreamRowResults(sqlRowStream, Object.class, transaction, new QueryHelper("table_name"), streamResult, context.asyncAssertSuccess(sr -> {
        sr.handler(streamHandler -> {
            events.append("[handler]");
        });
        sr.endHandler(x -> {
            events.append("[endHandler]");
            throw new NullPointerException("null");
        });
        sr.exceptionHandler(x -> {
            events.append("[exception]");
            context.assertEquals("SQLRowStream exception", x.getMessage());
            async.complete();
        });
    }));
    async.await(1000);
    context.assertEquals("[exception]", events.toString());
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) TestContext(io.vertx.ext.unit.TestContext) RowStream(io.vertx.sqlclient.RowStream) Arrays(java.util.Arrays) PgNotification(io.vertx.pgclient.PgNotification) TransactionRollbackException(io.vertx.sqlclient.TransactionRollbackException) VertxUtils(org.folio.rest.tools.utils.VertxUtils) Tuple(io.vertx.sqlclient.Tuple) UpdateSection(org.folio.rest.persist.Criteria.UpdateSection) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) RowIterator(io.vertx.sqlclient.RowIterator) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SqlResult(io.vertx.sqlclient.SqlResult) After(org.junit.After) JsonObject(io.vertx.core.json.JsonObject) Offset(org.folio.rest.persist.Criteria.Offset) Collector(java.util.stream.Collector) Transaction(io.vertx.sqlclient.Transaction) AfterClass(org.junit.AfterClass) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) RowImpl(io.vertx.pgclient.impl.RowImpl) Set(java.util.Set) UUID(java.util.UUID) FieldException(org.folio.cql2pgjson.exception.FieldException) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) UncheckedIOException(java.io.UncheckedIOException) IOUtils(org.apache.commons.io.IOUtils) CQL2PgJSON(org.folio.cql2pgjson.CQL2PgJSON) Base64(java.util.Base64) List(java.util.List) Stream(java.util.stream.Stream) Criterion(org.folio.rest.persist.Criteria.Criterion) Results(org.folio.rest.persist.interfaces.Results) Facet(org.folio.rest.jaxrs.model.Facet) RowDesc(io.vertx.sqlclient.impl.RowDesc) Async(io.vertx.ext.unit.Async) CQLWrapper(org.folio.rest.persist.cql.CQLWrapper) BeforeClass(org.junit.BeforeClass) FacetField(org.folio.rest.persist.facets.FacetField) PostgresTesterContainer(org.folio.postgres.testing.PostgresTesterContainer) Criteria(org.folio.rest.persist.Criteria.Criteria) CoreMatchers.not(org.hamcrest.CoreMatchers.not) RunWith(org.junit.runner.RunWith) Timeout(io.vertx.ext.unit.junit.Timeout) ResultInfo(org.folio.rest.jaxrs.model.ResultInfo) Function(java.util.function.Function) TotaledResults(org.folio.rest.persist.PostgresClient.TotaledResults) ArrayList(java.util.ArrayList) PreparedStatement(io.vertx.sqlclient.PreparedStatement) HashSet(java.util.HashSet) CompositeFuture(io.vertx.core.CompositeFuture) Poline(org.folio.rest.persist.helpers.Poline) PrepareOptions(io.vertx.sqlclient.PrepareOptions) SqlConnection(io.vertx.sqlclient.SqlConnection) Limit(org.folio.rest.persist.Criteria.Limit) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) RowSet(io.vertx.sqlclient.RowSet) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) AsyncResult(io.vertx.core.AsyncResult) LinkedList(java.util.LinkedList) DatabaseMetadata(io.vertx.sqlclient.spi.DatabaseMetadata) CoreMatchers.nullValue(org.hamcrest.CoreMatchers.nullValue) Before(org.junit.Before) Files(java.nio.file.Files) Query(io.vertx.sqlclient.Query) Promise(io.vertx.core.Promise) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Vertx(io.vertx.core.Vertx) PgPool(io.vertx.pgclient.PgPool) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) Test(org.junit.Test) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) PreparedQuery(io.vertx.sqlclient.PreparedQuery) JsonArray(io.vertx.core.json.JsonArray) PgConnection(io.vertx.pgclient.PgConnection) Rule(org.junit.Rule) Paths(java.nio.file.Paths) Row(io.vertx.sqlclient.Row) LocalRowSet(org.folio.rest.persist.helpers.LocalRowSet) Handler(io.vertx.core.Handler) SimplePojo(org.folio.rest.persist.helpers.SimplePojo) Collections(java.util.Collections) InputStream(java.io.InputStream) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) Transaction(io.vertx.sqlclient.Transaction) Async(io.vertx.ext.unit.Async) JsonObject(io.vertx.core.json.JsonObject) Row(io.vertx.sqlclient.Row) ResultInfo(org.folio.rest.jaxrs.model.ResultInfo) Test(org.junit.Test)

Example 2 with QueryHelper

use of org.folio.rest.persist.PostgresClient.QueryHelper in project raml-module-builder by folio-org.

the class PostgresClientIT method processQueryWithCountBelowOffset.

// offset >= estimated total https://issues.folio.org/browse/RMB-684
@Test
public void processQueryWithCountBelowOffset(TestContext context) {
    postgresClient = createNumbers(context, 1, 2, 3, 4, 5);
    postgresClient.startTx(context.asyncAssertSuccess(conn -> {
        QueryHelper queryHelper = new QueryHelper("numbers");
        queryHelper.selectQuery = "SELECT i FROM numbers ORDER BY i OFFSET 2";
        queryHelper.offset = 2;
        // estimation=1 is below offset=2
        queryHelper.countQuery = "SELECT 1";
        Function<TotaledResults, Results<Integer>> resultSetMapper = totaledResults -> {
            context.verify(verify -> {
                assertThat(totaledResults.estimatedTotal, is(1));
                assertThat(totaledResults.set.size(), is(3));
            });
            return null;
        };
        postgresClient.processQueryWithCount(conn.conn, queryHelper, "statMethod", resultSetMapper).onComplete(context.asyncAssertSuccess());
    }));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) TestContext(io.vertx.ext.unit.TestContext) RowStream(io.vertx.sqlclient.RowStream) Arrays(java.util.Arrays) PgNotification(io.vertx.pgclient.PgNotification) TransactionRollbackException(io.vertx.sqlclient.TransactionRollbackException) VertxUtils(org.folio.rest.tools.utils.VertxUtils) Tuple(io.vertx.sqlclient.Tuple) UpdateSection(org.folio.rest.persist.Criteria.UpdateSection) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) RowIterator(io.vertx.sqlclient.RowIterator) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SqlResult(io.vertx.sqlclient.SqlResult) After(org.junit.After) JsonObject(io.vertx.core.json.JsonObject) Offset(org.folio.rest.persist.Criteria.Offset) Collector(java.util.stream.Collector) Transaction(io.vertx.sqlclient.Transaction) AfterClass(org.junit.AfterClass) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) RowImpl(io.vertx.pgclient.impl.RowImpl) Set(java.util.Set) UUID(java.util.UUID) FieldException(org.folio.cql2pgjson.exception.FieldException) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) UncheckedIOException(java.io.UncheckedIOException) IOUtils(org.apache.commons.io.IOUtils) CQL2PgJSON(org.folio.cql2pgjson.CQL2PgJSON) Base64(java.util.Base64) List(java.util.List) Stream(java.util.stream.Stream) Criterion(org.folio.rest.persist.Criteria.Criterion) Results(org.folio.rest.persist.interfaces.Results) Facet(org.folio.rest.jaxrs.model.Facet) RowDesc(io.vertx.sqlclient.impl.RowDesc) Async(io.vertx.ext.unit.Async) CQLWrapper(org.folio.rest.persist.cql.CQLWrapper) BeforeClass(org.junit.BeforeClass) FacetField(org.folio.rest.persist.facets.FacetField) PostgresTesterContainer(org.folio.postgres.testing.PostgresTesterContainer) Criteria(org.folio.rest.persist.Criteria.Criteria) CoreMatchers.not(org.hamcrest.CoreMatchers.not) RunWith(org.junit.runner.RunWith) Timeout(io.vertx.ext.unit.junit.Timeout) ResultInfo(org.folio.rest.jaxrs.model.ResultInfo) Function(java.util.function.Function) TotaledResults(org.folio.rest.persist.PostgresClient.TotaledResults) ArrayList(java.util.ArrayList) PreparedStatement(io.vertx.sqlclient.PreparedStatement) HashSet(java.util.HashSet) CompositeFuture(io.vertx.core.CompositeFuture) Poline(org.folio.rest.persist.helpers.Poline) PrepareOptions(io.vertx.sqlclient.PrepareOptions) SqlConnection(io.vertx.sqlclient.SqlConnection) Limit(org.folio.rest.persist.Criteria.Limit) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) RowSet(io.vertx.sqlclient.RowSet) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) AsyncResult(io.vertx.core.AsyncResult) LinkedList(java.util.LinkedList) DatabaseMetadata(io.vertx.sqlclient.spi.DatabaseMetadata) CoreMatchers.nullValue(org.hamcrest.CoreMatchers.nullValue) Before(org.junit.Before) Files(java.nio.file.Files) Query(io.vertx.sqlclient.Query) Promise(io.vertx.core.Promise) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Vertx(io.vertx.core.Vertx) PgPool(io.vertx.pgclient.PgPool) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) Test(org.junit.Test) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) PreparedQuery(io.vertx.sqlclient.PreparedQuery) JsonArray(io.vertx.core.json.JsonArray) PgConnection(io.vertx.pgclient.PgConnection) Rule(org.junit.Rule) Paths(java.nio.file.Paths) Row(io.vertx.sqlclient.Row) LocalRowSet(org.folio.rest.persist.helpers.LocalRowSet) Handler(io.vertx.core.Handler) SimplePojo(org.folio.rest.persist.helpers.SimplePojo) Collections(java.util.Collections) InputStream(java.io.InputStream) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Function(java.util.function.Function) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) Test(org.junit.Test)

Example 3 with QueryHelper

use of org.folio.rest.persist.PostgresClient.QueryHelper in project raml-module-builder by folio-org.

the class Conn method get.

/**
 * Return records selected by {@link CQLWrapper} filter.
 *
 * @param table - table to query
 * @param clazz - class of objects to be returned
 * @param fieldName - database column to return, for example  @link {@link PostgresClient#DEFAULT_JSONB_FIELD_NAME}
 * @param wrapper - filter to select records
 * @param returnCount - whether to return totalRecords, the number of matching records when disabling OFFSET and LIMIT
 * @param returnIdField - if the id field should also be returned, must be true for facets
 * @param facets - fields to calculate counts for
 * @param distinctOn - database column to calculate the number of distinct values for, null or empty string for none
 */
public <T> Future<Results<T>> get(String table, Class<T> clazz, String fieldName, CQLWrapper wrapper, boolean returnCount, boolean returnIdField, List<FacetField> facets, String distinctOn) {
    try {
        QueryHelper queryHelper = postgresClient.buildQueryHelper(table, fieldName, wrapper, returnIdField, facets, distinctOn);
        Function<TotaledResults, Results<T>> resultSetMapper = totaledResults -> postgresClient.processResults(totaledResults.set, totaledResults.estimatedTotal, queryHelper.offset, queryHelper.limit, clazz);
        if (returnCount) {
            return postgresClient.processQueryWithCount(pgConnection, queryHelper, "get", resultSetMapper);
        } else {
            return Future.future(promise -> postgresClient.processQuery(pgConnection, queryHelper, null, "get", resultSetMapper, promise));
        }
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        return Future.failedFuture(e);
    }
}
Also used : RowStream(io.vertx.sqlclient.RowStream) CQLWrapper(org.folio.rest.persist.cql.CQLWrapper) FacetField(org.folio.rest.persist.facets.FacetField) Function(java.util.function.Function) TotaledResults(org.folio.rest.persist.PostgresClient.TotaledResults) Tuple(io.vertx.sqlclient.Tuple) ArrayList(java.util.ArrayList) UpdateSection(org.folio.rest.persist.Criteria.UpdateSection) FunctionWithException(org.folio.rest.persist.PostgresClient.FunctionWithException) MetadataUtil(org.folio.rest.tools.utils.MetadataUtil) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) Map(java.util.Map) JsonObject(io.vertx.core.json.JsonObject) RowSet(io.vertx.sqlclient.RowSet) AsyncResult(io.vertx.core.AsyncResult) Method(java.lang.reflect.Method) Promise(io.vertx.core.Promise) SqlUtil(org.folio.dbschema.util.SqlUtil) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) UUID(java.util.UUID) Future(io.vertx.core.Future) UncheckedIOException(java.io.UncheckedIOException) JsonArray(io.vertx.core.json.JsonArray) PgConnection(io.vertx.pgclient.PgConnection) List(java.util.List) Logger(org.apache.logging.log4j.Logger) Criterion(org.folio.rest.persist.Criteria.Criterion) Results(org.folio.rest.persist.interfaces.Results) Row(io.vertx.sqlclient.Row) LocalRowSet(org.folio.rest.persist.helpers.LocalRowSet) Handler(io.vertx.core.Handler) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) TotaledResults(org.folio.rest.persist.PostgresClient.TotaledResults) TotaledResults(org.folio.rest.persist.PostgresClient.TotaledResults) Results(org.folio.rest.persist.interfaces.Results) FunctionWithException(org.folio.rest.persist.PostgresClient.FunctionWithException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) UncheckedIOException(java.io.UncheckedIOException)

Example 4 with QueryHelper

use of org.folio.rest.persist.PostgresClient.QueryHelper in project raml-module-builder by folio-org.

the class PostgresClientIT method processQueryWithCountSqlFailure.

@Test
public void processQueryWithCountSqlFailure(TestContext context) {
    postgresClient = postgresClient();
    postgresClient.startTx(context.asyncAssertSuccess(conn -> {
        QueryHelper queryHelper = new QueryHelper("table");
        queryHelper.selectQuery = "'";
        queryHelper.countQuery = "'";
        postgresClient.processQueryWithCount(conn.conn, queryHelper, "statMethod", null).onComplete(context.asyncAssertFailure(fail -> {
            assertThat(fail.getMessage(), containsString("unterminated quoted string"));
        }));
    }));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) TestContext(io.vertx.ext.unit.TestContext) RowStream(io.vertx.sqlclient.RowStream) Arrays(java.util.Arrays) PgNotification(io.vertx.pgclient.PgNotification) TransactionRollbackException(io.vertx.sqlclient.TransactionRollbackException) VertxUtils(org.folio.rest.tools.utils.VertxUtils) Tuple(io.vertx.sqlclient.Tuple) UpdateSection(org.folio.rest.persist.Criteria.UpdateSection) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) RowIterator(io.vertx.sqlclient.RowIterator) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SqlResult(io.vertx.sqlclient.SqlResult) After(org.junit.After) JsonObject(io.vertx.core.json.JsonObject) Offset(org.folio.rest.persist.Criteria.Offset) Collector(java.util.stream.Collector) Transaction(io.vertx.sqlclient.Transaction) AfterClass(org.junit.AfterClass) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) RowImpl(io.vertx.pgclient.impl.RowImpl) Set(java.util.Set) UUID(java.util.UUID) FieldException(org.folio.cql2pgjson.exception.FieldException) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) UncheckedIOException(java.io.UncheckedIOException) IOUtils(org.apache.commons.io.IOUtils) CQL2PgJSON(org.folio.cql2pgjson.CQL2PgJSON) Base64(java.util.Base64) List(java.util.List) Stream(java.util.stream.Stream) Criterion(org.folio.rest.persist.Criteria.Criterion) Results(org.folio.rest.persist.interfaces.Results) Facet(org.folio.rest.jaxrs.model.Facet) RowDesc(io.vertx.sqlclient.impl.RowDesc) Async(io.vertx.ext.unit.Async) CQLWrapper(org.folio.rest.persist.cql.CQLWrapper) BeforeClass(org.junit.BeforeClass) FacetField(org.folio.rest.persist.facets.FacetField) PostgresTesterContainer(org.folio.postgres.testing.PostgresTesterContainer) Criteria(org.folio.rest.persist.Criteria.Criteria) CoreMatchers.not(org.hamcrest.CoreMatchers.not) RunWith(org.junit.runner.RunWith) Timeout(io.vertx.ext.unit.junit.Timeout) ResultInfo(org.folio.rest.jaxrs.model.ResultInfo) Function(java.util.function.Function) TotaledResults(org.folio.rest.persist.PostgresClient.TotaledResults) ArrayList(java.util.ArrayList) PreparedStatement(io.vertx.sqlclient.PreparedStatement) HashSet(java.util.HashSet) CompositeFuture(io.vertx.core.CompositeFuture) Poline(org.folio.rest.persist.helpers.Poline) PrepareOptions(io.vertx.sqlclient.PrepareOptions) SqlConnection(io.vertx.sqlclient.SqlConnection) Limit(org.folio.rest.persist.Criteria.Limit) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) RowSet(io.vertx.sqlclient.RowSet) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) AsyncResult(io.vertx.core.AsyncResult) LinkedList(java.util.LinkedList) DatabaseMetadata(io.vertx.sqlclient.spi.DatabaseMetadata) CoreMatchers.nullValue(org.hamcrest.CoreMatchers.nullValue) Before(org.junit.Before) Files(java.nio.file.Files) Query(io.vertx.sqlclient.Query) Promise(io.vertx.core.Promise) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Vertx(io.vertx.core.Vertx) PgPool(io.vertx.pgclient.PgPool) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) Test(org.junit.Test) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) PreparedQuery(io.vertx.sqlclient.PreparedQuery) JsonArray(io.vertx.core.json.JsonArray) PgConnection(io.vertx.pgclient.PgConnection) Rule(org.junit.Rule) Paths(java.nio.file.Paths) Row(io.vertx.sqlclient.Row) LocalRowSet(org.folio.rest.persist.helpers.LocalRowSet) Handler(io.vertx.core.Handler) SimplePojo(org.folio.rest.persist.helpers.SimplePojo) Collections(java.util.Collections) InputStream(java.io.InputStream) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) Test(org.junit.Test)

Example 5 with QueryHelper

use of org.folio.rest.persist.PostgresClient.QueryHelper in project raml-module-builder by folio-org.

the class PostgresClientTest method testProcessQueryWithCount.

@Test
public void testProcessQueryWithCount() {
    PostgresClient testClient = PostgresClient.testClient();
    QueryHelper queryHelper = new QueryHelper("test_pojo");
    queryHelper.selectQuery = "SELECT * FROM test_pojo";
    queryHelper.countQuery = "COUNT (*) FROM test_pojo";
    int total = 10;
    PgConnection connection = new FakeSqlConnection(Future.succeededFuture(getMockTestJsonbPojoResultSet(total)), false);
    testClient.processQueryWithCount(connection, queryHelper, "get", totaledResults -> {
        assertThat(totaledResults.estimatedTotal, is(total));
        return testClient.processResults(totaledResults.set, totaledResults.estimatedTotal, DEFAULT_OFFSET, DEFAULT_LIMIT, TestPojo.class);
    }).onSuccess(reply -> assertTestPojoResults(reply.getResults(), total));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) Arrays(java.util.Arrays) AES(org.folio.rest.security.AES) PgNotification(io.vertx.pgclient.PgNotification) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) User(org.folio.rest.jaxrs.model.User) SqlResult(io.vertx.sqlclient.SqlResult) Map(java.util.Map) After(org.junit.After) AESTest(org.folio.rest.security.AESTest) JsonObject(io.vertx.core.json.JsonObject) Collector(java.util.stream.Collector) Transaction(io.vertx.sqlclient.Transaction) Method(java.lang.reflect.Method) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) RowImpl(io.vertx.pgclient.impl.RowImpl) UUID(java.util.UUID) Future(io.vertx.core.Future) List(java.util.List) ResourceUtil(org.folio.util.ResourceUtil) ArrayMatching.hasItemInArray(org.hamcrest.collection.ArrayMatching.hasItemInArray) RowDesc(io.vertx.sqlclient.impl.RowDesc) FacetField(org.folio.rest.persist.facets.FacetField) Assert.assertThrows(org.junit.Assert.assertThrows) HashMap(java.util.HashMap) Function(java.util.function.Function) ArrayList(java.util.ArrayList) PreparedStatement(io.vertx.sqlclient.PreparedStatement) PrepareOptions(io.vertx.sqlclient.PrepareOptions) SqlConnection(io.vertx.sqlclient.SqlConnection) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) ArrayMatching.arrayContaining(org.hamcrest.collection.ArrayMatching.arrayContaining) RowSet(io.vertx.sqlclient.RowSet) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) AsyncResult(io.vertx.core.AsyncResult) LinkedList(java.util.LinkedList) DatabaseMetadata(io.vertx.sqlclient.spi.DatabaseMetadata) PostgresTester(org.folio.util.PostgresTester) Before(org.junit.Before) StringContainsInOrder.stringContainsInOrder(org.hamcrest.text.StringContainsInOrder.stringContainsInOrder) Envs(org.folio.rest.tools.utils.Envs) Query(io.vertx.sqlclient.Query) Vertx(io.vertx.core.Vertx) Test(org.junit.Test) PreparedQuery(io.vertx.sqlclient.PreparedQuery) NetworkUtils(org.folio.rest.tools.utils.NetworkUtils) Mockito(org.mockito.Mockito) PgConnection(io.vertx.pgclient.PgConnection) Assert.assertNull(org.junit.Assert.assertNull) Row(io.vertx.sqlclient.Row) PgConnectOptions(io.vertx.pgclient.PgConnectOptions) LocalRowSet(org.folio.rest.persist.helpers.LocalRowSet) Handler(io.vertx.core.Handler) Assert(org.junit.Assert) Assert.assertEquals(org.junit.Assert.assertEquals) QueryHelper(org.folio.rest.persist.PostgresClient.QueryHelper) PgConnection(io.vertx.pgclient.PgConnection) AESTest(org.folio.rest.security.AESTest) Test(org.junit.Test)

Aggregations

PgConnection (io.vertx.pgclient.PgConnection)8 ArrayList (java.util.ArrayList)6 QueryHelper (org.folio.rest.persist.PostgresClient.QueryHelper)6 AsyncResult (io.vertx.core.AsyncResult)5 Future (io.vertx.core.Future)5 Handler (io.vertx.core.Handler)5 JsonObject (io.vertx.core.json.JsonObject)5 Row (io.vertx.sqlclient.Row)5 RowSet (io.vertx.sqlclient.RowSet)5 Test (org.junit.Test)5 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)4 Promise (io.vertx.core.Promise)4 Vertx (io.vertx.core.Vertx)4 JsonArray (io.vertx.core.json.JsonArray)4 PgNotification (io.vertx.pgclient.PgNotification)4 RowImpl (io.vertx.pgclient.impl.RowImpl)4 PrepareOptions (io.vertx.sqlclient.PrepareOptions)4 PreparedQuery (io.vertx.sqlclient.PreparedQuery)4 PreparedStatement (io.vertx.sqlclient.PreparedStatement)4 Query (io.vertx.sqlclient.Query)4