Skip to content

Commit

Permalink
test: 파일 관련 테스트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SSung023 committed Apr 19, 2024
1 parent 55c5854 commit d859e07
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
import com.genius.gitget.challenge.instance.domain.Progress;
import com.genius.gitget.challenge.instance.repository.InstanceRepository;
import com.genius.gitget.challenge.user.domain.Role;
import com.genius.gitget.global.file.domain.FileType;
import com.genius.gitget.global.file.domain.Files;
import com.genius.gitget.global.file.service.FilesService;
import com.genius.gitget.util.TokenTestUtil;
import com.genius.gitget.util.WithMockCustomUser;
import com.genius.gitget.util.file.FileTestUtil;
import java.time.LocalDateTime;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -31,7 +28,6 @@
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;

@SpringBootTest
@Transactional
Expand Down Expand Up @@ -145,9 +141,6 @@ public void setup() {


private Topic getSavedTopic() {
MultipartFile filename = FileTestUtil.getMultipartFile("sky");
Files files = filesService.uploadFile(filename, FileType.TOPIC);

Topic topic = topicRepository.save(
Topic.builder()
.title("title")
Expand All @@ -157,8 +150,6 @@ private Topic getSavedTopic() {
.pointPerPerson(100)
.build()
);
topic.setFiles(files);

return topic;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
import com.genius.gitget.challenge.user.domain.Role;
import com.genius.gitget.challenge.user.domain.User;
import com.genius.gitget.challenge.user.repository.UserRepository;
import com.genius.gitget.global.file.domain.FileType;
import com.genius.gitget.global.file.domain.Files;
import com.genius.gitget.global.file.service.FilesService;
import com.genius.gitget.global.security.constants.ProviderInfo;
import com.genius.gitget.util.TokenTestUtil;
import com.genius.gitget.util.WithMockCustomUser;
import com.genius.gitget.util.file.FileTestUtil;
import java.time.LocalDateTime;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -40,7 +37,6 @@
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;

@SpringBootTest
@Transactional
Expand Down Expand Up @@ -229,9 +225,6 @@ private User getSavedUser() {


private Topic getSavedTopic() {
MultipartFile filename = FileTestUtil.getMultipartFile("sky");
Files files = filesService.uploadFile(filename, FileType.TOPIC);

Topic topic = topicRepository.save(
Topic.builder()
.title("title")
Expand All @@ -241,8 +234,6 @@ private Topic getSavedTopic() {
.pointPerPerson(100)
.build()
);
topic.setFiles(files);

return topic;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@
import com.genius.gitget.challenge.user.domain.Role;
import com.genius.gitget.challenge.user.domain.User;
import com.genius.gitget.challenge.user.repository.UserRepository;
import com.genius.gitget.global.file.domain.FileType;
import com.genius.gitget.global.file.domain.Files;
import com.genius.gitget.global.file.service.FilesService;
import com.genius.gitget.global.security.constants.ProviderInfo;
import com.genius.gitget.util.TokenTestUtil;
import com.genius.gitget.util.WithMockCustomUser;
import com.genius.gitget.util.file.FileTestUtil;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -43,7 +40,6 @@
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;


@SpringBootTest
Expand Down Expand Up @@ -278,9 +274,6 @@ private User getSavedUser() {
}

private Topic getSavedTopic() {
MultipartFile filename = FileTestUtil.getMultipartFile("sky");
Files files = filesService.uploadFile(filename, FileType.TOPIC);

Topic topic = topicRepository.save(
Topic.builder()
.title("title")
Expand All @@ -290,7 +283,6 @@ private Topic getSavedTopic() {
.pointPerPerson(100)
.build()
);
topic.setFiles(files);

return topic;
}
Expand Down

0 comments on commit d859e07

Please sign in to comment.