Open
Conversation
Board Model 과 Repository 에 한하여 Test 작성
minkukjo
reviewed
Aug 24, 2020
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| @Repository |
minkukjo
reviewed
Aug 24, 2020
Member
There was a problem hiding this comment.
BeforeEach로 매번 생성하기 보다는 BoardRepository를 빈으로 등록해놨으니 빈 주입을 받아서 쓰는게 어떨까요?
Author
There was a problem hiding this comment.
그거 @bean 으로 했더니 객체를 한번만 만들더라구요.. Test Isolation 이 안되서 어쩔수 없이 매번 생성하였습니다. Isolation 하는 방법좀 알려주세요.
Member
There was a problem hiding this comment.
@mingimin 원래 의도하신게 Isolation이면 지금처럼 해도 좋을 것 같습니다 👍 제가 착각했네요 죄송합니다
There was a problem hiding this comment.
Repository에서 데이터를 직접 들고 관리하다보니 이런 문제가 생겼군요. DB를 사용하게되면 트랜잭션 레벨로 분리가 되겠지만,
한번 자바스타일에 맞게끔 분리해보는 것도 좋을것 같네요!
kkw01234
reviewed
Aug 24, 2020
DongHyukki
reviewed
Aug 25, 2020
There was a problem hiding this comment.
(@RequestBody Board board)
이런식으로 받아올 수 있어요.
빌더 연습하려고 하신거면 죄송
There was a problem hiding this comment.
Repository에서 데이터를 직접 들고 관리하다보니 이런 문제가 생겼군요. DB를 사용하게되면 트랜잭션 레벨로 분리가 되겠지만,
한번 자바스타일에 맞게끔 분리해보는 것도 좋을것 같네요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Board Model 과 Repository 에 한하여 기본 Test 만 작성하였습니다.