diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactory.java index 483d6dd54ac..fec93529b00 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactory.java @@ -40,6 +40,9 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) { .set(propertyKey("langchain4j.open-ai.chat-model.log-requests"), propertyValue("true")) .set(propertyKey("langchain4j.open-ai.chat-model.log-responses"), propertyValue("true")) .and() + .springTestProperties() + .set(propertyKey("langchain4j.open-ai.chat-model.api-key"), propertyValue("jhipster")) + .and() .build(); //@formatter:on } diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactoryTest.java index fb51b511606..15e4afb3c67 100644 --- a/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactoryTest.java @@ -62,6 +62,16 @@ void shouldCreateModule() { log-responses: 'true' model-name: gpt-4o-mini """ + ) + .and() + .hasFile("src/test/resources/config/application-test.yml") + .containing( + """ + langchain4j: + open-ai: + chat-model: + api-key: jhipster + """ ); } }