Skip to content

Commit

Permalink
Merge pull request #653 from woowacourse-teams/test/645-template-tag-…
Browse files Browse the repository at this point in the history
…service

SourceCodeService 테스트 추가
  • Loading branch information
zangsu authored Sep 20, 2024
2 parents 5670cc5 + 362125e commit 42280db
Show file tree
Hide file tree
Showing 3 changed files with 508 additions and 0 deletions.
16 changes: 16 additions & 0 deletions backend/src/test/java/codezap/fixture/SourceCodeFixture.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package codezap.fixture;

import codezap.template.domain.SourceCode;
import codezap.template.domain.Template;

public class SourceCodeFixture {

public static SourceCode get(Template template, int ordinal) {
return new SourceCode(
template,
"file1.java",
"content1",
ordinal
);
}
}
38 changes: 38 additions & 0 deletions backend/src/test/java/codezap/global/ServiceTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package codezap.global;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import codezap.category.repository.CategoryRepository;
import codezap.member.repository.MemberRepository;
import codezap.tag.repository.TagRepository;
import codezap.tag.repository.TemplateTagRepository;
import codezap.template.repository.SourceCodeRepository;
import codezap.template.repository.TemplateRepository;
import codezap.template.repository.ThumbnailRepository;

@SpringBootTest
@DatabaseIsolation
public class ServiceTest {

@Autowired
protected MemberRepository memberRepository;

@Autowired
protected CategoryRepository categoryRepository;

@Autowired
protected TemplateRepository templateRepository;

@Autowired
protected TagRepository tagRepository;

@Autowired
protected TemplateTagRepository templateTagRepository;

@Autowired
protected SourceCodeRepository sourceCodeRepository;

@Autowired
protected ThumbnailRepository thumbnailRepository;
}
Loading

0 comments on commit 42280db

Please sign in to comment.