testing - Spring-boot-starter-test cannot run database integration test -
i'm running spring test, sadly still keep getting error
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: spring boot :: (v1.4.2.release) 2016-11-17 13:28:14.864 info 1372 --- [ main] b.c.medclin.boot.daostest.medicodaotest : starting medicodaotest on cta1 46063 pid 1372 (started viniciusbraga in c:\users\viniciusbraga\git\medcal) 2016-11-17 13:28:14.865 info 1372 --- [ main] b.c.medclin.boot.daostest.medicodaotest : no active profile set, falling default profiles: default 2016-11-17 13:28:14.881 info 1372 --- [ main] s.c.a.annotationconfigapplicationcontext : refreshing org.springframework .context.annotation.annotationconfigapplicationcontext@6f7e336b: startup date [thu nov 17 13:28:14 brst 2016]; root of context hie rarchy 2016-11-17 13:28:15.128 info 1372 --- [ main] beddeddatasourcebeanfactorypostprocessor : replacing 'datasource' datasou rce bean embedded version 2016-11-17 13:28:15.129 info 1372 --- [ main] o.s.b.f.s.defaultlistablebeanfactory : overriding bean definition bean 'datasource' different definition: replacing [root bean: class [null]; scope=; abstract=false; lazyinit=false; autowi remode=3; dependencycheck=0; autowirecandidate=true; primary=false; factorybeanname=org.springframework.boot.autoconfigure.jdbc.da tasourceconfiguration$tomcat; factorymethodname=datasource; initmethodname=null; destroymethodname=(inferred); defined in class pa th resource [org/springframework/boot/autoconfigure/jdbc/datasourceconfiguration$tomcat.class]] [root bean: class [org.spring framework.boot.test.autoconfigure.orm.jpa.testdatabaseautoconfiguration$embeddeddatasourcefactorybean]; scope=; abstract=false; la zyinit=false; autowiremode=0; dependencycheck=0; autowirecandidate=true; primary=false; factorybeanname=null; factorymethodname=nu ll; initmethodname=null; destroymethodname=null] 2016-11-17 13:28:15.129 warn 1372 --- [ main] o.s.c.a.configurationclasspostprocessor : cannot enhance @configuration bean definition 'embeddeddatasourcebeanfactorypostprocessor' since singleton instance has been created early. typical cause non-static @bean method beandefinitionregistrypostprocessor return type: consider declaring such methods 'sta tic'. 2016-11-17 13:28:15.176 warn 1372 --- [ main] s.c.a.annotationconfigapplicationcontext : exception encountered during c ontext initialization - cancelling refresh attempt: org.springframework.beans.factory.unsatisfieddependencyexception: error creati ng bean name 'org.springframework.boot.autoconfigure.orm.jpa.hibernatejpaautoconfiguration': unsatisfied dependency expressed through constructor parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource': invocation of init method failed; nested exception java.lang.illegalstateexception: cannot determine e mbedded database tests. if want embedded database please put supported 1 on classpath. 2016-11-17 13:28:15.178 info 1372 --- [ main] utoconfigurationreportlogginginitializer : error starting applicationcontext. display auto-configuration report re-run application 'debug' enabled. 2016-11-17 13:28:15.182 error 1372 --- [ main] o.s.boot.springapplication : application startup failed org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.boot.autoconf igure.orm.jpa.hibernatejpaautoconfiguration': unsatisfied dependency expressed through constructor parameter 0; nested exception s org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource': invocation of init method f ailed; nested exception java.lang.illegalstateexception: cannot determine embedded database tests. if want embedded database please put supported 1 on classpath. @ org.springframework.beans.factory.support.constructorresolver.createargumentarray(constructorresolver.java:749) ~[spring-beans -4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.constructorresolver.autowireconstructor(constructorresolver.java:189) ~[spring-beans -4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.autowireconstructor(abstractautowirecapablebeanfa ctory.java:1148) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfac tory.java:1050) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.j ava:512) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.jav a:482) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.4.r elease.jar:4.3.4.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[s pring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.4.rel ease.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:197) ~[spring-beans-4.3.4.relea se.jar:4.3.4.release] @ org.springframework.beans.factory.support.constructorresolver.instantiateusingfactorymethod(constructorresolver.java:372) ~[sp ring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.instantiateusingfactorymethod(abstractautowirecap ablebeanfactory.java:1128) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfac tory.java:1022) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.j ava:512) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.jav a:482) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.4.r elease.jar:4.3.4.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[s pring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.4.rel ease.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:197) ~[spring-beans-4.3.4.relea se.jar:4.3.4.release] @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:1081) ~[spring-context- 4.3.4.release.jar:4.3.4.release] @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java :856) ~[spring-context-4.3.4.release.jar:4.3.4.release] @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:542) ~[spring-context-4 .3.4.release.jar:4.3.4.release] @ org.springframework.boot.springapplication.refresh(springapplication.java:761) ~[spring-boot-1.4.2.release.jar:1.4.2.release] @ org.springframework.boot.springapplication.refreshcontext(springapplication.java:371) ~[spring-boot-1.4.2.release.jar:1.4.2.re lease] @ org.springframework.boot.springapplication.run(springapplication.java:315) ~[spring-boot-1.4.2.release.jar:1.4.2.release] @ org.springframework.boot.test.context.springbootcontextloader.loadcontext(springbootcontextloader.java:111) [spring-boot-test- 1.4.2.release.jar:1.4.2.release] @ org.springframework.test.context.cache.defaultcacheawarecontextloaderdelegate.loadcontextinternal(defaultcacheawarecontextload erdelegate.java:98) [spring-test-4.3.4.release.jar:4.3.4.release] @ org.springframework.test.context.cache.defaultcacheawarecontextloaderdelegate.loadcontext(defaultcacheawarecontextloaderdelega te.java:116) [spring-test-4.3.4.release.jar:4.3.4.release] @ org.springframework.test.context.support.defaulttestcontext.getapplicationcontext(defaulttestcontext.java:83) [spring-test-4.3 .4.release.jar:4.3.4.release] @ org.springframework.boot.test.autoconfigure.springbootdependencyinjectiontestexecutionlistener.preparetestinstance(springbootd ependencyinjectiontestexecutionlistener.java:47) [spring-boot-test-autoconfigure-1.4.2.release.jar:1.4.2.release] @ org.springframework.test.context.testcontextmanager.preparetestinstance(testcontextmanager.java:230) [spring-test-4.3.4.releas e.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner.createtest(springjunit4classrunner.java:228) [spring-test-4.3. 4.release.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner$1.runreflectivecall(springjunit4classrunner.java:287) [spring- test-4.3.4.release.jar:4.3.4.release] @ org.junit.internal.runners.model.reflectivecallable.run(reflectivecallable.java:12) [junit-4.12.jar:4.12] @ org.springframework.test.context.junit4.springjunit4classrunner.methodblock(springjunit4classrunner.java:289) [spring-test-4.3 .4.release.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner.runchild(springjunit4classrunner.java:247) [spring-test-4.3.4. release.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner.runchild(springjunit4classrunner.java:94) [spring-test-4.3.4.r elease.jar:4.3.4.release] @ org.junit.runners.parentrunner$3.run(parentrunner.java:290) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:71) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner.runchildren(parentrunner.java:288) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner.access$000(parentrunner.java:58) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:268) [junit-4.12.jar:4.12] @ org.springframework.test.context.junit4.statements.runbeforetestclasscallbacks.evaluate(runbeforetestclasscallbacks.java:61) [ spring-test-4.3.4.release.jar:4.3.4.release] @ org.springframework.test.context.junit4.statements.runaftertestclasscallbacks.evaluate(runaftertestclasscallbacks.java:70) [sp ring-test-4.3.4.release.jar:4.3.4.release] @ org.junit.runners.parentrunner.run(parentrunner.java:363) [junit-4.12.jar:4.12] @ org.springframework.test.context.junit4.springjunit4classrunner.run(springjunit4classrunner.java:191) [spring-test-4.3.4.relea se.jar:4.3.4.release] @ org.eclipse.jdt.internal.junit4.runner.junit4testreference.run(junit4testreference.java:86) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.testexecution.run(testexecution.java:38) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:459) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:678) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.run(remotetestrunner.java:382) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.main(remotetestrunner.java:192) [.cp/:na] caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource': invocation of init method failed; nested exception java.lang.illegalstateexception: cannot determine embedded database tests. if want embedded database please put supported 1 on classpath. @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory .java:1583) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.j ava:553) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.jav a:482) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.4.r elease.jar:4.3.4.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[s pring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.4.rel ease.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:202) ~[spring-beans-4.3.4.relea se.jar:4.3.4.release] @ org.springframework.beans.factory.config.dependencydescriptor.resolvecandidate(dependencydescriptor.java:207) ~[spring-beans-4 .3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.defaultlistablebeanfactory.doresolvedependency(defaultlistablebeanfactory.java:1131) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.defaultlistablebeanfactory.resolvedependency(defaultlistablebeanfactory.java:1059) ~ [spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.constructorresolver.resolveautowiredargument(constructorresolver.java:835) ~[spring- beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.constructorresolver.createargumentarray(constructorresolver.java:741) ~[spring-beans -4.3.4.release.jar:4.3.4.release] ... 51 common frames omitted caused by: java.lang.illegalstateexception: cannot determine embedded database tests. if want embedded database please put supported 1 on classpath. @ org.springframework.util.assert.state(assert.java:392) ~[spring-core-4.3.4.release.jar:4.3.4.release] @ org.springframework.boot.test.autoconfigure.orm.jpa.testdatabaseautoconfiguration$embeddeddatasourcefactory.getembeddeddatabas e(testdatabaseautoconfiguration.java:195) ~[spring-boot-test-autoconfigure-1.4.2.release.jar:1.4.2.release] @ org.springframework.boot.test.autoconfigure.orm.jpa.testdatabaseautoconfiguration$embeddeddatasourcefactorybean.afterpropertie sset(testdatabaseautoconfiguration.java:160) ~[spring-boot-test-autoconfigure-1.4.2.release.jar:1.4.2.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfact ory.java:1642) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory .java:1579) ~[spring-beans-4.3.4.release.jar:4.3.4.release] ... 62 common frames omitted 2016-11-17 13:28:15.186 error 1372 --- [ main] o.s.test.context.testcontextmanager : caught exception while allowin g testexecutionlistener [org.springframework.boot.test.autoconfigure.springbootdependencyinjectiontestexecutionlistener@57d5872c] prepare test instance [br.com.medclin.boot.daostest.medicodaotest@23382f76] java.lang.illegalstateexception: failed load applicationcontext @ org.springframework.test.context.cache.defaultcacheawarecontextloaderdelegate.loadcontext(defaultcacheawarecontextloaderdelega te.java:124) ~[spring-test-4.3.4.release.jar:4.3.4.release] @ org.springframework.test.context.support.defaulttestcontext.getapplicationcontext(defaulttestcontext.java:83) ~[spring-test-4. 3.4.release.jar:4.3.4.release] @ org.springframework.boot.test.autoconfigure.springbootdependencyinjectiontestexecutionlistener.preparetestinstance(springbootd ependencyinjectiontestexecutionlistener.java:47) ~[spring-boot-test-autoconfigure-1.4.2.release.jar:1.4.2.release] @ org.springframework.test.context.testcontextmanager.preparetestinstance(testcontextmanager.java:230) ~[spring-test-4.3.4.relea se.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner.createtest(springjunit4classrunner.java:228) [spring-test-4.3. 4.release.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner$1.runreflectivecall(springjunit4classrunner.java:287) [spring- test-4.3.4.release.jar:4.3.4.release] @ org.junit.internal.runners.model.reflectivecallable.run(reflectivecallable.java:12) [junit-4.12.jar:4.12] @ org.springframework.test.context.junit4.springjunit4classrunner.methodblock(springjunit4classrunner.java:289) [spring-test-4.3 .4.release.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner.runchild(springjunit4classrunner.java:247) [spring-test-4.3.4. release.jar:4.3.4.release] @ org.springframework.test.context.junit4.springjunit4classrunner.runchild(springjunit4classrunner.java:94) [spring-test-4.3.4.r elease.jar:4.3.4.release] @ org.junit.runners.parentrunner$3.run(parentrunner.java:290) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:71) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner.runchildren(parentrunner.java:288) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner.access$000(parentrunner.java:58) [junit-4.12.jar:4.12] @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:268) [junit-4.12.jar:4.12] @ org.springframework.test.context.junit4.statements.runbeforetestclasscallbacks.evaluate(runbeforetestclasscallbacks.java:61) [ spring-test-4.3.4.release.jar:4.3.4.release] @ org.springframework.test.context.junit4.statements.runaftertestclasscallbacks.evaluate(runaftertestclasscallbacks.java:70) [sp ring-test-4.3.4.release.jar:4.3.4.release] @ org.junit.runners.parentrunner.run(parentrunner.java:363) [junit-4.12.jar:4.12] @ org.springframework.test.context.junit4.springjunit4classrunner.run(springjunit4classrunner.java:191) [spring-test-4.3.4.relea se.jar:4.3.4.release] @ org.eclipse.jdt.internal.junit4.runner.junit4testreference.run(junit4testreference.java:86) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.testexecution.run(testexecution.java:38) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:459) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:678) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.run(remotetestrunner.java:382) [.cp/:na] @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.main(remotetestrunner.java:192) [.cp/:na] caused by: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.bo ot.autoconfigure.orm.jpa.hibernatejpaautoconfiguration': unsatisfied dependency expressed through constructor parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource': invocation of in method failed; nested exception java.lang.illegalstateexception: cannot determine embedded database tests. if want n embedded database please put supported 1 on classpath. @ org.springframework.beans.factory.support.constructorresolver.createargumentarray(constructorresolver.java:749) ~[spring-beans -4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.constructorresolver.autowireconstructor(constructorresolver.java:189) ~[spring-beans -4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.autowireconstructor(abstractautowirecapablebeanfa ctory.java:1148) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfac tory.java:1050) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.j ava:512) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.jav a:482) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.4.r elease.jar:4.3.4.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[s pring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.4.rel ease.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:197) ~[spring-beans-4.3.4.relea se.jar:4.3.4.release] @ org.springframework.beans.factory.support.constructorresolver.instantiateusingfactorymethod(constructorresolver.java:372) ~[sp ring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.instantiateusingfactorymethod(abstractautowirecap ablebeanfactory.java:1128) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfac tory.java:1022) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.j ava:512) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.jav a:482) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.4.r elease.jar:4.3.4.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[s pring-beans-4.3.4.release.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.4.rel ease.jar:4.3.4.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:197) ~[spring-beans-4.3.4.relea se.jar:4.3.4.release] @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:1081) ~[spring-context- 4.3.4.release.jar:4.3.4.release] @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java :856) ~[spring-context-4.3.4.release.jar:4.3.4.release] @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:542) ~[spring-context-4 .3.4.release.jar:4.3.4.release] @ org.springframework.boot.springapplication.refresh(springapplication.java:761) ~[spring-boot-1.4.2.release.jar:1.4.2.release] @ org.springframework.boot.springapplication.refreshcontext(springapplication.java:371) ~[spring-boot-1.4.2.release.jar:1.4.2.re lease] @ org.springframework.boot.springapplication.run(springapplication.java:315) ~[spring-boot-1.4.2.release.jar:1.4.2.release] @ org.springframework.boot.test.context.springbootcontextloader.loadcontext(springbootcontextloader.java:111) ~[spring-boot-test -1.4.2.release.jar:1.4.2.release] @ org.springframework.test.context.cache.defaultcacheawarecontextloaderdelegate.loadcontextinternal(defaultcacheawarecontextload erdelegate.java:98) ~[spring-test-4.3.4.release.jar:4.3.4.release] @ org.springframework.test.context.cache.defaultcacheawarecontextloaderdelegate.loadcontext(defaultcacheawarecontextloaderdelega te.java:116) ~[spring-test-4.3.4.release.jar:4.3.4.release] ... 24 common frames omitted caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource': invocation of init method failed; nested exception java.lang.illegalstateexception: cannot determine embedded database tests. if want embedded database please put supported 1 on classpath. @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory .java:1583) ~[spring-beans-4.3.4.release.jar:4.3.4.release] @
this particular line getting me intrigued.
org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.boot.autoconf igure.orm.jpa.hibernatejpaautoconfiguration': unsatisfied dependency expressed through constructor parameter 0; nested exception s org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource': invocation of init method f ailed; nested exception java.lang.illegalstateexception: cannot determine embedded database tests. if want embedded database please put supported 1 on classpath.
in other similar posts, suggested create new applications.properties under src/test/resources
. tried, still didn't work. here is.
#spring boot properties #thu nov 03 23:37:28 edt 2016 #server.port=9393 spring.datasource.driver-class-name=com.mysql.jdbc.driver #spring.datasource.username=root #spring.datasource.password="" spring.jpa.hibernate.ddl-auto=create-drop #spring.datasource.sql-script-encoding=utf-8 #spring.datasource.url=jdbc:mysql://localhost:3306/medcal spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.mysql5dialect #spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.datasource.sql-script-encoding=utf-8 #spring.messages.encoding=utf-8 #server.tomcat.uri-encoding=utf-8 #encoding html e tyhmeleaf #spring.http.encoding.charset=utf-8 #spring.thymeleaf.mode=html5 #spring.thymeleaf.encoding=utf-8
problem partially solved.
first, had put annotation @autoconfiguretestdatabase on class medicodaotest.
leaving code this:
... @autoconfiguretestdatabase(replace=replace.none) public class medicodaotest { ...
then changed application.properties under src/tests/resources
spring.datasource.driver-class-name=com.mysql.jdbc.driver spring.datasource.username=root #spring.datasource.password="" spring.datasource.sql-script-encoding=utf-8 spring.datasource.url=jdbc:mysql://localhost:3306/medcaltest spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.mysql5dialect spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.datasource.sql-script-encoding=utf-8 spring.messages.encoding=utf-8 server.tomcat.uri-encoding=utf-8
then, jpa , mapping started work
Comments
Post a Comment