diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/infrastructure/primary/SampleJpaPersistenceModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/infrastructure/primary/SampleJpaPersistenceModuleConfiguration.java new file mode 100644 index 00000000000..408d9f39ec6 --- /dev/null +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/infrastructure/primary/SampleJpaPersistenceModuleConfiguration.java @@ -0,0 +1,34 @@ +package tech.jhipster.lite.generator.server.springboot.mvc.sample.jpapersistence.infrastructure.primary; + +import static tech.jhipster.lite.shared.slug.domain.JHLiteFeatureSlug.SAMPLE_PERSISTENCE; +import static tech.jhipster.lite.shared.slug.domain.JHLiteFeatureSlug.SAMPLE_SCHEMA; +import static tech.jhipster.lite.shared.slug.domain.JHLiteModuleSlug.SAMPLE_JPA_PERSISTENCE; +import static tech.jhipster.lite.shared.slug.domain.JHLiteModuleSlug.SPRING_BOOT_CUCUMBER_JPA_RESET; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import tech.jhipster.lite.generator.server.springboot.mvc.sample.jpapersistence.application.SampleJpaPersistenceApplicationService; +import tech.jhipster.lite.module.domain.resource.JHipsterModuleOrganization; +import tech.jhipster.lite.module.domain.resource.JHipsterModulePropertiesDefinition; +import tech.jhipster.lite.module.domain.resource.JHipsterModuleResource; + +@Configuration +class SampleJpaPersistenceModuleConfiguration { + + @Bean + JHipsterModuleResource sampleJpaPersistenceModule(SampleJpaPersistenceApplicationService sampleJpaPersistence) { + return JHipsterModuleResource.builder() + .slug(SAMPLE_JPA_PERSISTENCE) + .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) + .apiDoc("Sample Feature", "Add JPA persistence for sample feature") + .organization( + JHipsterModuleOrganization.builder() + .feature(SAMPLE_PERSISTENCE) + .addDependency(SAMPLE_SCHEMA) + .addDependency(SPRING_BOOT_CUCUMBER_JPA_RESET) + .build() + ) + .tags("server") + .factory(sampleJpaPersistence::buildModule); + } +} diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/domain/SampleLangChain4jModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/domain/SampleJpaPersistenceModuleFactoryTest.java similarity index 98% rename from src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/domain/SampleLangChain4jModuleFactoryTest.java rename to src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/domain/SampleJpaPersistenceModuleFactoryTest.java index 276c4b665a6..6c4f0e074a0 100644 --- a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/domain/SampleLangChain4jModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/sample/jpapersistence/domain/SampleJpaPersistenceModuleFactoryTest.java @@ -10,7 +10,7 @@ import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; @UnitTest -class SampleLangChain4jModuleFactoryTest { +class SampleJpaPersistenceModuleFactoryTest { private static final SampleJpaPersistenceModuleFactory factory = new SampleJpaPersistenceModuleFactory();