title: How to write unit tests with H2 in-memory database
body: <p>my question might be a little bit strange but I do not really know how to write unit tests for my already existing application ( I know I should first write the unit tests and afterwards the main souce code ).</p>
  
  <p>My application consists of some tables that will be created automatically from my Java classes. My production database is PostgreSQL.</p>
  
  <p>Now, I want to write some unit tests with my H2 database.
  However, I use some data types ( some special annotation - date/time ) that are not supported by H2.</p>
  
  <p>Should I write now the wrong model classes new in my test package with the correct data types so that H2 is able to create the tables?
  Or is there some other approach that I do not know of?</p>
  
  <p>Thank you very much for your help and hints in advance!</p>