cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CAP Java: CSV data in the test/data folder not loaded duirng local testing

MioYasutake
SAP Champion
SAP Champion
1,143

Hi community, 

According to the capire document, CSV data in test/data folder is loaded by default.

https://cap.cloud.sap/docs/guides/databases?impl-variant=java#providing-initial-data

... next to your CDS model files. When you use cds watch or cds deploy, CSV files are loaded by default from test/data. 

However, CSV data in the test/data folder is not loaded during local testing (when running the service with mvn spring-boot:run).

MioYasutake_0-1758688967423.png

MioYasutake_1-1758689053125.png

I have tried adding the folllowing setting to the application.yaml and run the application with `mvn spring-boot:run -Dspring-boot.run.profiles=test`, but it's not taking effect.

---
spring:
  config.activate.on-profile: test
  sql.init.platform: h2
cds:
  data-source.auto-config.enabled: false
  dataSource.csv.paths:
  - test/data/**

I would like to confirm whether I am missing any steps.

 

Accepted Solutions (1)

Accepted Solutions (1)

MioYasutake
SAP Champion
SAP Champion

Data has been loaded by adding the following configuration to the default profile:

  dataSource.csv.paths:
    - ../test/data/**

 Here is the overall configuration of the application.yaml.

---
spring:
  config.activate.on-profile: default
  sql.init.platform: h2
cds:
  data-source.auto-config.enabled: false
  dataSource.csv.paths:
    - ../test/data/**

 

Answers (0)