Skip to content

Commit

Permalink
[BUG FIX] #356: 테스트코드 오류 수정(value 주입 못하는 버그)
Browse files Browse the repository at this point in the history
  • Loading branch information
tank3a committed Aug 20, 2023
1 parent 4bb0db3 commit 66e8fc6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -11,6 +12,7 @@
import java.net.http.HttpResponse;

@Service
@PropertySource("classpath:application-test.yml")
public class RecommendService {

@Value("${python.url}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -60,6 +61,7 @@ void findAllModelTypeData() {
.isDefaultModel(false)
.modelBoughtCount(1800L)
.modelPrice(0L)
.modelImage("/model/8seats.jpg")
.build();

//when
Expand Down
19 changes: 19 additions & 0 deletions backend/src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 66e8fc6

Please sign in to comment.