From 1d249982e74580e3a73ae9d51d1204330642fae0 Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:16:41 +0200 Subject: [PATCH 01/11] move fixtures dir from src/main/resources into project root --- {src/main/resources/fixtures => fixtures}/0010_settings.json | 0 {src/main/resources/fixtures => fixtures}/0100_user-accounts.json | 0 {src/main/resources/fixtures => fixtures}/0110_api-keys.json | 0 {src/main/resources/fixtures => fixtures}/0120_saved-queries.json | 0 .../fixtures => fixtures}/0200_metadata-schemas_resource.json | 0 .../fixtures => fixtures}/0210_metadata-schemas_data-service.json | 0 .../0220_metadata-schemas_metadata-service.json | 0 .../fixtures => fixtures}/0230_metadata-schemas_fdp.json | 0 .../fixtures => fixtures}/0240_metadata-schemas_catalog.json | 0 .../fixtures => fixtures}/0250_metadata-schemas_dataset.json | 0 .../fixtures => fixtures}/0260_metadata-schemas_distribution.json | 0 .../0300_resource-definitions_distribution.json | 0 .../fixtures => fixtures}/0310_resource-definitions_dataset.json | 0 .../fixtures => fixtures}/0320_resource-definitions_catalog.json | 0 .../0330_resource-definitions_repository.json | 0 .../resources/fixtures => fixtures}/0400_memberships_owner.json | 0 .../fixtures => fixtures}/0410_memberships_data-provider.json | 0 17 files changed, 0 insertions(+), 0 deletions(-) rename {src/main/resources/fixtures => fixtures}/0010_settings.json (100%) rename {src/main/resources/fixtures => fixtures}/0100_user-accounts.json (100%) rename {src/main/resources/fixtures => fixtures}/0110_api-keys.json (100%) rename {src/main/resources/fixtures => fixtures}/0120_saved-queries.json (100%) rename {src/main/resources/fixtures => fixtures}/0200_metadata-schemas_resource.json (100%) rename {src/main/resources/fixtures => fixtures}/0210_metadata-schemas_data-service.json (100%) rename {src/main/resources/fixtures => fixtures}/0220_metadata-schemas_metadata-service.json (100%) rename {src/main/resources/fixtures => fixtures}/0230_metadata-schemas_fdp.json (100%) rename {src/main/resources/fixtures => fixtures}/0240_metadata-schemas_catalog.json (100%) rename {src/main/resources/fixtures => fixtures}/0250_metadata-schemas_dataset.json (100%) rename {src/main/resources/fixtures => fixtures}/0260_metadata-schemas_distribution.json (100%) rename {src/main/resources/fixtures => fixtures}/0300_resource-definitions_distribution.json (100%) rename {src/main/resources/fixtures => fixtures}/0310_resource-definitions_dataset.json (100%) rename {src/main/resources/fixtures => fixtures}/0320_resource-definitions_catalog.json (100%) rename {src/main/resources/fixtures => fixtures}/0330_resource-definitions_repository.json (100%) rename {src/main/resources/fixtures => fixtures}/0400_memberships_owner.json (100%) rename {src/main/resources/fixtures => fixtures}/0410_memberships_data-provider.json (100%) diff --git a/src/main/resources/fixtures/0010_settings.json b/fixtures/0010_settings.json similarity index 100% rename from src/main/resources/fixtures/0010_settings.json rename to fixtures/0010_settings.json diff --git a/src/main/resources/fixtures/0100_user-accounts.json b/fixtures/0100_user-accounts.json similarity index 100% rename from src/main/resources/fixtures/0100_user-accounts.json rename to fixtures/0100_user-accounts.json diff --git a/src/main/resources/fixtures/0110_api-keys.json b/fixtures/0110_api-keys.json similarity index 100% rename from src/main/resources/fixtures/0110_api-keys.json rename to fixtures/0110_api-keys.json diff --git a/src/main/resources/fixtures/0120_saved-queries.json b/fixtures/0120_saved-queries.json similarity index 100% rename from src/main/resources/fixtures/0120_saved-queries.json rename to fixtures/0120_saved-queries.json diff --git a/src/main/resources/fixtures/0200_metadata-schemas_resource.json b/fixtures/0200_metadata-schemas_resource.json similarity index 100% rename from src/main/resources/fixtures/0200_metadata-schemas_resource.json rename to fixtures/0200_metadata-schemas_resource.json diff --git a/src/main/resources/fixtures/0210_metadata-schemas_data-service.json b/fixtures/0210_metadata-schemas_data-service.json similarity index 100% rename from src/main/resources/fixtures/0210_metadata-schemas_data-service.json rename to fixtures/0210_metadata-schemas_data-service.json diff --git a/src/main/resources/fixtures/0220_metadata-schemas_metadata-service.json b/fixtures/0220_metadata-schemas_metadata-service.json similarity index 100% rename from src/main/resources/fixtures/0220_metadata-schemas_metadata-service.json rename to fixtures/0220_metadata-schemas_metadata-service.json diff --git a/src/main/resources/fixtures/0230_metadata-schemas_fdp.json b/fixtures/0230_metadata-schemas_fdp.json similarity index 100% rename from src/main/resources/fixtures/0230_metadata-schemas_fdp.json rename to fixtures/0230_metadata-schemas_fdp.json diff --git a/src/main/resources/fixtures/0240_metadata-schemas_catalog.json b/fixtures/0240_metadata-schemas_catalog.json similarity index 100% rename from src/main/resources/fixtures/0240_metadata-schemas_catalog.json rename to fixtures/0240_metadata-schemas_catalog.json diff --git a/src/main/resources/fixtures/0250_metadata-schemas_dataset.json b/fixtures/0250_metadata-schemas_dataset.json similarity index 100% rename from src/main/resources/fixtures/0250_metadata-schemas_dataset.json rename to fixtures/0250_metadata-schemas_dataset.json diff --git a/src/main/resources/fixtures/0260_metadata-schemas_distribution.json b/fixtures/0260_metadata-schemas_distribution.json similarity index 100% rename from src/main/resources/fixtures/0260_metadata-schemas_distribution.json rename to fixtures/0260_metadata-schemas_distribution.json diff --git a/src/main/resources/fixtures/0300_resource-definitions_distribution.json b/fixtures/0300_resource-definitions_distribution.json similarity index 100% rename from src/main/resources/fixtures/0300_resource-definitions_distribution.json rename to fixtures/0300_resource-definitions_distribution.json diff --git a/src/main/resources/fixtures/0310_resource-definitions_dataset.json b/fixtures/0310_resource-definitions_dataset.json similarity index 100% rename from src/main/resources/fixtures/0310_resource-definitions_dataset.json rename to fixtures/0310_resource-definitions_dataset.json diff --git a/src/main/resources/fixtures/0320_resource-definitions_catalog.json b/fixtures/0320_resource-definitions_catalog.json similarity index 100% rename from src/main/resources/fixtures/0320_resource-definitions_catalog.json rename to fixtures/0320_resource-definitions_catalog.json diff --git a/src/main/resources/fixtures/0330_resource-definitions_repository.json b/fixtures/0330_resource-definitions_repository.json similarity index 100% rename from src/main/resources/fixtures/0330_resource-definitions_repository.json rename to fixtures/0330_resource-definitions_repository.json diff --git a/src/main/resources/fixtures/0400_memberships_owner.json b/fixtures/0400_memberships_owner.json similarity index 100% rename from src/main/resources/fixtures/0400_memberships_owner.json rename to fixtures/0400_memberships_owner.json diff --git a/src/main/resources/fixtures/0410_memberships_data-provider.json b/fixtures/0410_memberships_data-provider.json similarity index 100% rename from src/main/resources/fixtures/0410_memberships_data-provider.json rename to fixtures/0410_memberships_data-provider.json From 9a5c110fa0d4c0e058a5aadc34e60793a27cee35 Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:18:37 +0200 Subject: [PATCH 02/11] wire BootstrapProperties into BootstrapConfig using constructor injection instead of field injection --- src/main/java/org/fairdatapoint/config/BootstrapConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java index d6659a0b..cdb8f77c 100644 --- a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java +++ b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java @@ -22,6 +22,7 @@ */ package org.fairdatapoint.config; +import org.fairdatapoint.config.properties.BootstrapProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; @@ -36,6 +37,11 @@ @Configuration public class BootstrapConfig { private final ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); + private final BootstrapProperties bootstrapProperties; + + public BootstrapConfig(BootstrapProperties bootstrapProperties) { + this.bootstrapProperties = bootstrapProperties; + } @Bean public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { From 44aea3b0fafcb707ba04e9866124e29e9ca6d55a Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:19:57 +0200 Subject: [PATCH 03/11] get fixtures from dir specified in bootstrap.db-fixtures-path --- src/main/java/org/fairdatapoint/config/BootstrapConfig.java | 5 ++++- .../fairdatapoint/config/properties/BootstrapProperties.java | 1 + src/main/resources/application.yml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java index cdb8f77c..7f1dc3be 100644 --- a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java +++ b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java @@ -31,6 +31,7 @@ import org.springframework.data.repository.init.Jackson2RepositoryPopulatorFactoryBean; import java.io.IOException; +import java.nio.file.Path; import java.util.Arrays; import java.util.Comparator; @@ -48,7 +49,9 @@ public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { final Jackson2RepositoryPopulatorFactoryBean factory = new Jackson2RepositoryPopulatorFactoryBean(); // load all json resources from the fixtures dir try { - final Resource[] resources = resourceResolver.getResources("classpath:fixtures/*.json"); + // collect fixture resources + final Path fixturesPath = Path.of(bootstrapProperties.getDbFixturesPath(), "*.json"); + final Resource[] resources = resourceResolver.getResources("file:" + fixturesPath); // sort resources to guarantee lexicographic order Arrays.sort( resources, diff --git a/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java b/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java index a7180009..48733664 100644 --- a/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java +++ b/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java @@ -36,4 +36,5 @@ public class BootstrapProperties { private boolean enabled; private String dataPath; + private String dbFixturesPath; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 32b61c87..96b6627a 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -115,3 +115,4 @@ server: bootstrap: enabled: true data-path: '/data' + db-fixtures-path: "fixtures" From 9706c09779b73c558aef60ab72e09e8741ff42b6 Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:44:39 +0200 Subject: [PATCH 04/11] copy db fixtures dir into docker image --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index ec1a9fb2..6040315e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,5 +26,6 @@ USER spring:spring WORKDIR /fdp COPY --from=builder /builder/target/fdp-spring-boot.jar /fdp/app.jar +COPY --from=builder /builder/fixtures /fdp/fixtures ENTRYPOINT ["java", "-jar", "app.jar"] From 52e72f0397cf1f5d7c1e4a8d61d3ca276d6674ff Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Fri, 17 Oct 2025 17:43:41 +0200 Subject: [PATCH 05/11] add some todos w.r.t. rdf data dir --- Dockerfile | 1 + src/main/resources/application.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6040315e..59274584 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,5 +27,6 @@ WORKDIR /fdp COPY --from=builder /builder/target/fdp-spring-boot.jar /fdp/app.jar COPY --from=builder /builder/fixtures /fdp/fixtures +# TODO: copy the (rdf) "data" dir as well, or move that into the fixtures dir, e.g. fixtures/rdf and fixtures/db ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 96b6627a..465eaaf5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -114,5 +114,6 @@ server: bootstrap: enabled: true + # TODO: consistent naming for rdf data path and db fixtures path data-path: '/data' db-fixtures-path: "fixtures" From 9779545b54d6b9d51e95cf61ba7eb284d8e91cdc Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:02:59 +0200 Subject: [PATCH 06/11] use bootstrap.enabled property in populator and use @Value injection instead of BootstrapProperties this makes it slightly more difficult to see where the properties are defined in code, but easier to see the name of the actual property in the external config file --- .../fairdatapoint/config/BootstrapConfig.java | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java index 7f1dc3be..b3fe6587 100644 --- a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java +++ b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java @@ -22,7 +22,7 @@ */ package org.fairdatapoint.config; -import org.fairdatapoint.config.properties.BootstrapProperties; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; @@ -38,33 +38,40 @@ @Configuration public class BootstrapConfig { private final ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); - private final BootstrapProperties bootstrapProperties; + private final boolean bootstrapEnabled; + private final Path dbFixturesPath; - public BootstrapConfig(BootstrapProperties bootstrapProperties) { - this.bootstrapProperties = bootstrapProperties; + public BootstrapConfig( + @Value("${bootstrap.enabled:false}") boolean bootstrapEnabled, + @Value("${bootstrap.db-fixtures-path}") String dbFixturesDir + ) { + this.bootstrapEnabled = bootstrapEnabled; + this.dbFixturesPath = Path.of(dbFixturesDir); } @Bean public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { final Jackson2RepositoryPopulatorFactoryBean factory = new Jackson2RepositoryPopulatorFactoryBean(); - // load all json resources from the fixtures dir - try { - // collect fixture resources - final Path fixturesPath = Path.of(bootstrapProperties.getDbFixturesPath(), "*.json"); - final Resource[] resources = resourceResolver.getResources("file:" + fixturesPath); - // sort resources to guarantee lexicographic order - Arrays.sort( - resources, - Comparator.comparing( - Resource::getFilename, - Comparator.nullsLast(String::compareTo) - ) - ); - factory.setResources(resources); - } - catch (IOException exception) { - exception.printStackTrace(); + if (bootstrapEnabled) { + try { + // collect fixture resources + final Path fixturesPath = dbFixturesPath.resolve("*.json"); + final Resource[] resources = resourceResolver.getResources("file:" + fixturesPath); + // sort resources to guarantee lexicographic order + Arrays.sort( + resources, + Comparator.comparing( + Resource::getFilename, + Comparator.nullsLast(String::compareTo) + ) + ); + factory.setResources(resources); + } + catch (IOException exception) { + exception.printStackTrace(); + } } + return factory; } } From 48a87589fabf73bffd9793e37e0787dad16be9de Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:04:02 +0200 Subject: [PATCH 07/11] add some bootstrap logging --- src/main/java/org/fairdatapoint/config/BootstrapConfig.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java index b3fe6587..496f9382 100644 --- a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java +++ b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java @@ -22,6 +22,7 @@ */ package org.fairdatapoint.config; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -36,6 +37,7 @@ import java.util.Comparator; @Configuration +@Slf4j public class BootstrapConfig { private final ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); private final boolean bootstrapEnabled; @@ -53,6 +55,7 @@ public BootstrapConfig( public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { final Jackson2RepositoryPopulatorFactoryBean factory = new Jackson2RepositoryPopulatorFactoryBean(); if (bootstrapEnabled) { + log.info("Bootstrap repository populator enabled"); try { // collect fixture resources final Path fixturesPath = dbFixturesPath.resolve("*.json"); @@ -70,6 +73,8 @@ public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { catch (IOException exception) { exception.printStackTrace(); } + } else { + log.info("Bootstrap repository populator disabled"); } return factory; From a1ddea28f2e8ed56522ce6f44bf2c92db56e8869 Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:45:38 +0200 Subject: [PATCH 08/11] remove bootstrap.enabled from application.yml we want to rely on the default false, and only override by setting environment property BOOTSTRAP_ENABLED on the command line --- src/main/resources/application.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 465eaaf5..7aed496d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -113,7 +113,6 @@ server: forward-headers-strategy: framework bootstrap: - enabled: true # TODO: consistent naming for rdf data path and db fixtures path data-path: '/data' db-fixtures-path: "fixtures" From 1e050f601487a8152acdb83886563539fbf3e4dc Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:14:09 +0200 Subject: [PATCH 09/11] rename dbFixturesPath property to dbFixturesDir --- src/main/java/org/fairdatapoint/config/BootstrapConfig.java | 2 +- .../fairdatapoint/config/properties/BootstrapProperties.java | 3 ++- src/main/resources/application.yml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java index 496f9382..c20164c2 100644 --- a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java +++ b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java @@ -45,7 +45,7 @@ public class BootstrapConfig { public BootstrapConfig( @Value("${bootstrap.enabled:false}") boolean bootstrapEnabled, - @Value("${bootstrap.db-fixtures-path}") String dbFixturesDir + @Value("${bootstrap.db-fixtures-dir}") String dbFixturesDir ) { this.bootstrapEnabled = bootstrapEnabled; this.dbFixturesPath = Path.of(dbFixturesDir); diff --git a/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java b/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java index 48733664..bb5a1909 100644 --- a/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java +++ b/src/main/java/org/fairdatapoint/config/properties/BootstrapProperties.java @@ -36,5 +36,6 @@ public class BootstrapProperties { private boolean enabled; private String dataPath; - private String dbFixturesPath; + // directories relative to project root + private String dbFixturesDir; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7aed496d..191da5a7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -113,6 +113,6 @@ server: forward-headers-strategy: framework bootstrap: - # TODO: consistent naming for rdf data path and db fixtures path + # TODO: consistent naming for rdf data path and db fixtures dir data-path: '/data' - db-fixtures-path: "fixtures" + db-fixtures-dir: "fixtures" From 06084a2159441442f0e89238fcb37329b8c295ec Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:52:36 +0200 Subject: [PATCH 10/11] add instructions to BootstrapConfig javadoc --- .../org/fairdatapoint/config/BootstrapConfig.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java index c20164c2..f25f63bd 100644 --- a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java +++ b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java @@ -36,6 +36,17 @@ import java.util.Arrays; import java.util.Comparator; +/** + * The {@code BootstrapConfig} class configures a repository populator to load initial data into the relational database, based on JSON fixture files. + * Bootstrapping is disabled by default, and should only be enabled once, on the very first run of the application. + * It can also be enabled on subsequent runs, but then it will overwrite any changes that may have been made by users. + * To enable on the first run, set the env variable {@code BOOTSTRAP_ENABLED=true} on the command line, before running the app. + * When using e.g. docker compose, you can define {@code BOOTSTRAP_ENABLED: ${BOOTSTRAP_ENABLED:-false}} in the {@code environment} section and then set up the stack by running {@code BOOTSTRAP_ENABLED=true docker compose up -d}. + * The default fixtures are located in the {@code /fixtures} directory. + * To add custom fixtures and/or override any of the default fixtures in a docker compose setup, we can bind-mount individual fixture files. + * For example: {@code ./my-fixtures/0100_user-accounts.json:/fdp/fixtures/0100_user-accounts.json:ro} + * Note that bind-mounting the entire directory, instead of individual files, would hide all default files. + */ @Configuration @Slf4j public class BootstrapConfig { From eef76db3739b893ffcdc29c45e06d63b6403b7d4 Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Fri, 24 Oct 2025 16:57:51 +0200 Subject: [PATCH 11/11] fix checkstyle issues --- .../fairdatapoint/config/BootstrapConfig.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java index f25f63bd..4c05478a 100644 --- a/src/main/java/org/fairdatapoint/config/BootstrapConfig.java +++ b/src/main/java/org/fairdatapoint/config/BootstrapConfig.java @@ -37,13 +37,17 @@ import java.util.Comparator; /** - * The {@code BootstrapConfig} class configures a repository populator to load initial data into the relational database, based on JSON fixture files. + * The {@code BootstrapConfig} class configures a repository populator to load initial data into the relational + * database, based on JSON fixture files. * Bootstrapping is disabled by default, and should only be enabled once, on the very first run of the application. * It can also be enabled on subsequent runs, but then it will overwrite any changes that may have been made by users. - * To enable on the first run, set the env variable {@code BOOTSTRAP_ENABLED=true} on the command line, before running the app. - * When using e.g. docker compose, you can define {@code BOOTSTRAP_ENABLED: ${BOOTSTRAP_ENABLED:-false}} in the {@code environment} section and then set up the stack by running {@code BOOTSTRAP_ENABLED=true docker compose up -d}. + * To enable on the first run, set the env variable {@code BOOTSTRAP_ENABLED=true} on the command line, before running + * the app. + * When using e.g. docker compose, you can define {@code BOOTSTRAP_ENABLED: ${BOOTSTRAP_ENABLED:-false}} in the + * {@code environment} section and then set up the stack by running {@code BOOTSTRAP_ENABLED=true docker compose up -d}. * The default fixtures are located in the {@code /fixtures} directory. - * To add custom fixtures and/or override any of the default fixtures in a docker compose setup, we can bind-mount individual fixture files. + * To add custom fixtures and/or override any of the default fixtures in a docker compose setup, we can bind-mount + * individual fixture files. * For example: {@code ./my-fixtures/0100_user-accounts.json:/fdp/fixtures/0100_user-accounts.json:ro} * Note that bind-mounting the entire directory, instead of individual files, would hide all default files. */ @@ -65,7 +69,7 @@ public BootstrapConfig( @Bean public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { final Jackson2RepositoryPopulatorFactoryBean factory = new Jackson2RepositoryPopulatorFactoryBean(); - if (bootstrapEnabled) { + if (bootstrapEnabled) { log.info("Bootstrap repository populator enabled"); try { // collect fixture resources @@ -84,7 +88,8 @@ public Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { catch (IOException exception) { exception.printStackTrace(); } - } else { + } + else { log.info("Bootstrap repository populator disabled"); }