Skip to content

Commit 5861689

Browse files
authored
Merge pull request #114 from classic-daramg/fix/ai-comment-test-detached-assertion
[fix] processJob 테스트 detached entity 상태 체크 수정
2 parents 275d84c + f460913 commit 5861689

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/com/daramg/server/aicomment/application/AiCommentServiceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ class ProcessJobTest {
272272
aiCommentService.processJob(job);
273273

274274
// then
275-
assertThat(job.getStatus()).isEqualTo(AiCommentJobStatus.DONE);
275+
AiCommentJob savedJob = aiCommentJobRepository.findById(job.getId()).orElseThrow();
276+
assertThat(savedJob.getStatus()).isEqualTo(AiCommentJobStatus.DONE);
276277

277278
List<Comment> comments = commentRepository.findAll();
278279
assertThat(comments).hasSize(1);
@@ -302,7 +303,8 @@ class ProcessJobTest {
302303
aiCommentService.processJob(job);
303304

304305
// then
305-
assertThat(job.getStatus()).isEqualTo(AiCommentJobStatus.FAILED);
306+
AiCommentJob savedJob = aiCommentJobRepository.findById(job.getId()).orElseThrow();
307+
assertThat(savedJob.getStatus()).isEqualTo(AiCommentJobStatus.FAILED);
306308
assertThat(commentRepository.findAll()).isEmpty();
307309
}
308310
}

0 commit comments

Comments
 (0)