diff --git a/backend/src/main/java/autoever2/cartag/service/RecommendService.java b/backend/src/main/java/autoever2/cartag/service/RecommendService.java index 55a4b8c..f9b1095 100644 --- a/backend/src/main/java/autoever2/cartag/service/RecommendService.java +++ b/backend/src/main/java/autoever2/cartag/service/RecommendService.java @@ -3,6 +3,7 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Service; import java.net.URI; @@ -11,6 +12,7 @@ import java.net.http.HttpResponse; @Service +@PropertySource("classpath:application-test.yml") public class RecommendService { @Value("${python.url}") diff --git a/backend/src/test/java/autoever2/cartag/repository/ModelRepositoryTest.java b/backend/src/test/java/autoever2/cartag/repository/ModelRepositoryTest.java index 38f5637..5aa4146 100644 --- a/backend/src/test/java/autoever2/cartag/repository/ModelRepositoryTest.java +++ b/backend/src/test/java/autoever2/cartag/repository/ModelRepositoryTest.java @@ -50,6 +50,7 @@ void findAllModelTypeData() { .modelPrice(1480000L) .maxPs("202/3800") .maxKgfm("45.0/1750~2750") + .modelImage("/model/diesel2-2.jpg") .build(); ModelShortMappedDto sixthModel = ModelShortMappedDto.builder() @@ -60,6 +61,7 @@ void findAllModelTypeData() { .isDefaultModel(false) .modelBoughtCount(1800L) .modelPrice(0L) + .modelImage("/model/8seats.jpg") .build(); //when diff --git a/backend/src/test/resources/application-test.yml b/backend/src/test/resources/application-test.yml new file mode 100644 index 0000000..a3374c9 --- /dev/null +++ b/backend/src/test/resources/application-test.yml @@ -0,0 +1,19 @@ +spring: + config: + activate: + on-profile: test + h2: + console: + enabled: true + datasource: + url: jdbc:h2:mem:test;MODE=MySQL; + username: sa + password: + driver-class-name: org.h2.Driver + sql: + init: + mode: always + schema-locations: classpath:schema-h2.sql + +python: + url: http://localhost:5001/test