Difference in HSQL and MySQL
<p>I am using MySQL as my application database, but HSQL as test in-memory database. Now the issue is I have a SQL selectQuery like below : </p>

<pre><code>SELECT date(a.created_at) as record_date 
FROM table a
</code></pre>

<p>Now, date() is a function in MYSQL for converting DateTime to Date, but in HSQL the same function is to_date(). Now, I have a method which hits the above query to database and gets output.</p>

<pre><code>public Response dbQueryThroughJdbcTemplate(String selectQuery){
       jdbcTemplate.query(selectQuery, RowMapper); //RowMapper maps output to Response  
    }
</code></pre>

<p>Now, I have a test method for testing this method, </p>

<pre><code>@Test
public void testDbQueryThroughJdbcTemplate(){
       Response response = dbQueryThroughJdbcTemplate(selectQuery);
       TestCase.assertEquals(expected, response); // avoided the code for making expected object
}
</code></pre>

<p>Now, as the test environment is using HSQL db, the test throws an error that date method is not available.</p>

<p>How to come out of this issue, or any better way to achieve this?</p>