fixing tests + replace inMemoryDB by postgresql DB