Class SQLRequester


  • public class SQLRequester
    extends Object
    A SQL requester for integration tests. It uses the DataSourceProvider to get a connection to the database used by the integration tests.
    Author:
    mmoquillon
    • Method Detail

      • findOne

        public static Map<String,​Object> findOne​(String query,
                                                       Object... parameters)
                                                throws SQLException
        Finds one and only one entity by executing the specified SQL query with the given parameters. If there is more than one entity found then an IllegalArgumentException is thrown.
        Parameters:
        query - the query to use to find one entity.
        parameters - the parameters to apply with the query.
        Returns:
        a Map with the persisted attributes of the asked entity. The name of the attributes are all in uppercase.
        Throws:
        SQLException - if an error occurs while executing the given SQL query.