Issue
Here is some description. java. lang. IllegalArgumentException: DataSource must not be null
at org.springframework.util.Assert.notNull(Assert.java:201)
at org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup.<init>(SingleDataSourceLookup.java:40)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.setDataSource(LocalContainerEntityManagerFactoryBean.java:257)
at org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder$Builder.build(EntityManagerFactoryBuilder.java:234)
at com.cardinalhealth.nphsden.framework.utils.DbUtils.getEntityManagerFactory(DbUtils.java:38)
at com.cardinalhealth.nphsden.framework.utils.DbUtilsTest.testGetEntityManagerFactory(DbUtilsTest.java:53)
Solution
use this - > pgDataSource = dataSourceBuilder.create().build();
instead of - > pgDataSource = dataSourceBuilder.build();
Answered By - Ashwin Sharma
Answer Checked By - Senaida (JavaFixing Volunteer)