mercredi 21 septembre 2016

In-memory H2 database, insert not working in SpringBootTest

I have a SpringBootApplicationWhich I wish to test.

Below are the details about my files

application.properties

spring.datasource.platform=h2
spring.datasource.username=sa
spring.datasource.password=sa

datasource1 Settings # Both point to in memory h2

datasource2 Settings

ConfigurationClass

Creates beans for data and few others.

Main Test Class

Uses one of the db1 beans and successfully inserts some data
This data is dynamic changes with every test case.
Now this calls a spring boot application where this inserted data is fetched
But unfortunately, no data is retrieved.

Please Help! PS for the spring boot application the test beans are being picked so bean instantiation definitely not a problem. I think I am missing some properties.

Aucun commentaire:

Enregistrer un commentaire