Skip to content

Commit

Permalink
fix: Keyword 저장 시 세션과의 연관 관계 violation 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
nuyh99 committed Aug 2, 2023
1 parent f9bf902 commit a4e8892
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import wooteco.prolog.roadmap.domain.RecommendedPost;
import wooteco.prolog.roadmap.domain.repository.KeywordRepository;
import wooteco.prolog.roadmap.domain.repository.RecommendedRepository;
import wooteco.prolog.session.domain.Session;
import wooteco.prolog.session.domain.repository.SessionRepository;

import java.util.Optional;

Expand All @@ -28,13 +30,15 @@ class RecommendedServiceTest {
private RecommendedRepository recommendedRepository;
@Autowired
private KeywordRepository keywordRepository;
@Autowired
private SessionRepository sessionRepository;

private Keyword keyword;

@BeforeEach
public void init() {
final Keyword keyword = Keyword.createKeyword("이름", "설명", 1, 1, 1L, null);
this.keyword = keywordRepository.save(keyword);
final Session session = sessionRepository.save(new Session("레벨 1"));
this.keyword = keywordRepository.save(Keyword.createKeyword("이름", "설명", 1, 1, session.getId(), null));
}

@Test
Expand Down

0 comments on commit a4e8892

Please sign in to comment.