title: spring test not populating database configuration from application.properties
body: <p>In my spring boot application, I have the following class that calls a stored procedure</p>
  
  <pre><code>public class FmTrfUtil {
      static int returnVal;
  
      public static int insertFmTrfs(List&lt;String&gt; trfs, String source) {
          EntityManager em = Persistence.createEntityManagerFactory("RIStore_FM").createEntityManager();
          Session session = em.unwrap( Session.class );
          final String[] trfArray = trfs.toArray(new String[trfs.size()]);
          final String src = source;
  
          session.doWork( new Work(){
              public void execute(Connection conn) throws SQLException {
                  CallableStatement stmt = null;        
                  OracleConnection oraCon = conn.unwrap(OracleConnection.class);
                  Array array = oraCon.createARRAY("VARCHAR2_TAB_T", trfArray);
                  stmt = conn.prepareCall("{? = call FM_TRF_UTIL.process_fm_trf(?,?)}");
                  stmt.registerOutParameter(1, Types.INTEGER);
                  stmt.setArray(2, array);
                  stmt.setString(3, src);
                  stmt.execute();
                  returnVal = stmt.getInt(1);
              }
          });
          return returnVal;
      }
  }
  </code></pre>
  
  <p>Now I would like to run integration test on this class using spring test following example in <a href="https://www.jayway.com/2014/07/04/integration-testing-a-spring-boot-application/" rel="nofollow noreferrer">Integration Testing a Spring Boot Application</a>. </p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @SpringApplicationConfiguration(classes = RistoreWebApplication.class)
  @WebAppConfiguration
  public class FmTrfUtilTest {
  
      static EntityManagerFactory factory = null;
      static EntityManager manager = null;
  
      @Test
      public void test() {
          List&lt;String&gt; trfs = new ArrayList&lt;String&gt;();
          trfs.add("TRF000001");
          trfs.add("TRF000002");
          int ret = FmTrfUtil.insertFmTrfs(trfs, "SARC");
          assertTrue(ret &gt; 0);
      }
  }
  </code></pre>
  
  <p>Here <code>RistoreWebApplication</code> is the name of the main app class which is the entry point of the api. According to that web page, "The <code>@SpringApplicationConfiguration</code> annotation will trigger logic for reading Spring Boot specific configurations, properties, and so on." My understanding is this will load database connection information in my application.properties as well:</p>
  
  <pre><code>spring.datasource.url=jdbc:oracle:thin:@ldap://xxx:389/risdev3, cn=OracleContext,dc=yyy,dc=com
  spring.datasource.username=rowner
  spring.datasource.password=rowner987
  spring.datasource.driverClassName=oracle.jdbc.OracleDriver
  </code></pre>
  
  <p>However, when I run this test, I got <code>UnsupportedOperationException: The application must supply JDBC connections</code>. How exactly do I load the db connection config running the test? I am using spring boot 1.3</p>
  
  <p><strong>EDIT</strong>
  since application.properties lives in src/main/resources while my test classes are in src/test/java, I figured I'd have another property file under <code>src/test/resources</code> based on the answer to <a href="https://stackoverflow.com/questions/32974432/spring-junit-testing-properties-file">Spring jUnit Testing properties file</a>. So I did that and added annotation <code>@PropertySource("classpath:application-test.properties")</code> in my test class, but still getting the same error. Is there a way to know whether the property file is being read and/or what is the current classpath?</p>