FarmersAndFarmmunity / farmers

0 stars 0 forks source link

item, cart testcase 통과 안됨 #71

Closed Kim-youngjae closed 1 year ago

Kim-youngjae commented 1 year ago
could not prepare statement [Table "ITEM" not found (this database is empty); SQL statement:
There was an unexpected error (type=Internal Server Error, status=500).
An error happened during template parsing (template: "class path resource [templates/item/itemDtl.html]")
org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/item/itemDtl.html]")
Kim-youngjae commented 1 year ago

itemService TC 실패, cartService TC 실패

소영님 답변

이유는 모르겠는데 새로 test 넣어두시면서 
@ActiveProfiles("test") // application-test.yml 을 활성화 시킨다.
이거로 넣어두신걸 전처럼 
@TestPropertySource(locations="classpath:application-test.yml")
이걸로 하면 다 통과하긴 하네요!
whale22 commented 1 year ago

application.yml에서 database: mysql가 잘못된 문법이었음! 삭제하거나 정상적인 문법으로 수정하면 @ActiveProfiles("test") // application-test.yml 을 활성화 시킨다. 로 실행해도 테스트가 정상작동함