File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
java/org/fairdatapoint/config Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 3131import org .springframework .data .repository .init .Jackson2RepositoryPopulatorFactoryBean ;
3232
3333import java .io .IOException ;
34+ import java .nio .file .Path ;
3435import java .util .Arrays ;
3536import java .util .Comparator ;
3637
@@ -48,7 +49,9 @@ public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() {
4849 final Jackson2RepositoryPopulatorFactoryBean factory = new Jackson2RepositoryPopulatorFactoryBean ();
4950 // load all json resources from the fixtures dir
5051 try {
51- final Resource [] resources = resourceResolver .getResources ("classpath:fixtures/*.json" );
52+ // collect fixture resources
53+ final Path fixturesPath = Path .of (bootstrapProperties .getDbFixturesPath (), "*.json" );
54+ final Resource [] resources = resourceResolver .getResources ("file:" + fixturesPath );
5255 // sort resources to guarantee lexicographic order
5356 Arrays .sort (
5457 resources ,
Original file line number Diff line number Diff line change 3636public class BootstrapProperties {
3737 private boolean enabled ;
3838 private String dataPath ;
39+ private String dbFixturesPath ;
3940}
Original file line number Diff line number Diff line change @@ -115,3 +115,4 @@ server:
115115bootstrap :
116116 enabled : true
117117 data-path : ' /data'
118+ db-fixtures-path : " fixtures"
You can’t perform that action at this time.
0 commit comments