From 66e8fc6af73d5f7de807713af24089d2fce0a7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=80=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=A9=E1=86=BC?= =?UTF-8?q?=E1=84=8B=E1=85=AF=E1=86=AB=20Jongwon?= Date: Sun, 20 Aug 2023 18:19:26 +0900 Subject: [PATCH] =?UTF-8?q?[BUG=20FIX]=20#356:=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EC=BD=94=EB=93=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95(value=20=EC=A3=BC=EC=9E=85=20=EB=AA=BB=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EB=B2=84=EA=B7=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cartag/service/RecommendService.java | 2 ++ .../repository/ModelRepositoryTest.java | 2 ++ .../src/test/resources/application-test.yml | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 backend/src/test/resources/application-test.yml 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