Skip to content

Commit

Permalink
[#160] test: PostServiceTest 단위테스트로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
shin-mallang committed Dec 16, 2023
1 parent b1e8518 commit 5120240
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 367 deletions.
24 changes: 24 additions & 0 deletions src/test/java/com/mallang/post/DraftFixture.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mallang.post;

import com.mallang.blog.domain.Blog;
import com.mallang.post.domain.draft.Draft;
import java.util.Collections;
import org.springframework.test.util.ReflectionTestUtils;

public class DraftFixture {

public static Draft draft(Long id, Blog blog) {
Draft draft = new Draft(
blog,
"title",
"intro",
"content",
null,
null,
Collections.emptyList(),
blog.getOwner()
);
ReflectionTestUtils.setField(draft, "id", 1L);
return draft;
}
}
Loading

0 comments on commit 5120240

Please sign in to comment.