diff --git a/.github/workflows/CI-CD-Test.yml b/.github/workflows/CI-CD-Test.yml index 21b65f5..b274a48 100644 --- a/.github/workflows/CI-CD-Test.yml +++ b/.github/workflows/CI-CD-Test.yml @@ -61,3 +61,4 @@ jobs: app-name: crono # Reemplaza con el nombre de tu App Service para testing publish-profile: ${{ secrets.AZURETESTENVIRONMENT }} package: '*.jar' + diff --git a/.gitignore b/.gitignore index 062bad1..418b895 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ build/ .env errorLog.txt requirements.pdf +4_Maven Verify.txt \ No newline at end of file diff --git a/src/test/java/edu/eci/cvds/prometeo/PrometeoApplicationTests.java b/src/test/java/edu/eci/cvds/prometeo/PrometeoApplicationTests.java index dd32b4a..dbc4783 100644 --- a/src/test/java/edu/eci/cvds/prometeo/PrometeoApplicationTests.java +++ b/src/test/java/edu/eci/cvds/prometeo/PrometeoApplicationTests.java @@ -2,8 +2,10 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; @SpringBootTest +@ActiveProfiles("test") class PrometeoApplicationTests { @Test diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties new file mode 100644 index 0000000..0e3af6c --- /dev/null +++ b/src/test/resources/application-test.properties @@ -0,0 +1,14 @@ +# Base de datos H2 en memoria para pruebas +spring.datasource.url=jdbc:h2:mem:testdb;MODE=PostgreSQL +spring.datasource.username=sa +spring.datasource.password= +spring.datasource.driver-class-name=org.h2.Driver +spring.jpa.hibernate.ddl-auto=create-drop + +# Configuración adicional para mejorar pruebas +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.jpa.defer-datasource-initialization=true + +# Configuración mínima para OpenAI en pruebas +openai.api.key=test-key +openai.api.url=https://test-url.com \ No newline at end of file