Skip to content

Commit

Permalink
Merge pull request #24 from yetJunior/test/GJ-14-user-nickname-refactor
Browse files Browse the repository at this point in the history
[✅Test] User의 nickname 칼럼 스키마 변경에 대한 테스트 코드 수정
  • Loading branch information
juhee77 authored Oct 3, 2023
2 parents 9df0c51 + e1b4bbe commit 7fe360c
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void init() {
"articlecontrollertestuser1@gmail.com",
null,
null,
null
"ArticleControllerTestUser1"
);
user1 = userRepository.save(user1);

Expand All @@ -107,7 +107,7 @@ public void init() {
"articlecontrollertestuser2@gmail.com",
null,
null,
null
"ArticleControllerTestUser2"
);
user2 = userRepository.save(user2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public static void afterAll() {

@BeforeEach
public void init() {
seller = User.of("user1", "password", "email1@", "oauthName1", null, null);
seller2 = User.of("seller2", "password", "seller2@", "seller2", null, null);
consumer = User.of("user2", "password", "email2@", "oauthName2", null, null);
seller = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
seller2 = User.of("seller2", "password", "seller2@", "seller2", null, "seller2");
consumer = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
seller = userRepository.save(seller);
seller2 = userRepository.save(seller2);
consumer = userRepository.save(consumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public static void afterAll() {

@BeforeEach
public void init() {
seller = User.of("user1", "password", "email1@", "oauthName1", null, null);
consumer = User.of("user2", "password", "email2@", "oauthName2", null, null);
seller = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
consumer = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
seller = userRepository.save(seller);
consumer = userRepository.save(consumer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void setup() {
}

private void initializeEntities() {
consumer = User.of("user2", "password", "email2@", "oauthName2", null, null);
consumer = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
consumer = userRepository.save(consumer);

article = Article.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ public static void afterAll() {
@BeforeEach
public void init() {

reviewer1 = User.of("user1", "password", "email1@", "oauthName1", null, null);
reviewer1 = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
reviewer1 = userRepository.save(reviewer1);

reviewer2 = User.of("user2", "password", "email2@", "oauthName2", null, null);
reviewer2 = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
reviewer2 = userRepository.save(reviewer2);

User seller = User.of("seller", "password", "sellerEmail@", "sellerOauthName", null, null);
User seller = User.of("seller", "password", "sellerEmail@", "sellerOauthName", null, "seller");
seller = userRepository.save(seller);

article = Article.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public class ArticleRepositoryTest {

@BeforeEach
public void init() {
user1 = User.of("ArticleRepositoryTestUser1", "1234", "user1@gmail.com", null, null, null);
user1 = User.of("ArticleRepositoryTestUser1", "1234", "user1@gmail.com", null, null, "ArticleRepositoryTestUser1");

user1 = userRepository.save(user1);

user2 = User.of("ArticleRepositoryTestUser2", "1234", "user2@gmail.com", null, null, null);
user2 = User.of("ArticleRepositoryTestUser2", "1234", "user2@gmail.com", null, null, "ArticleRepositoryTestUser2");

user2 = userRepository.save(user2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class OrderRepositoryTest {

@BeforeEach
public void init() {
user = userRepository.save(User.of("user", "password", "email", "oauthName", null, null));
user = userRepository.save(User.of("user", "password", "email", "oauthName", null, "user"));
when(userService.getByApiId(any())).thenReturn(user);

article = articleRepository.save(Article.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class ChatroomUserRepositoryTest {

@BeforeEach
public void init() {
user1 = User.of("user1", "password", "email1@", "oauthName1", null, null);
user2 = User.of("seller2", "password", "seller2@", "seller2", null, null);
user1 = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
user2 = User.of("seller2", "password", "seller2@", "seller2", null, "seller2");
user1 = userRepository.save(user1);
user2 = userRepository.save(user2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ArticleServiceTest {

@BeforeEach
public void init() {
user = User.of("ArticleServiceTestUser", "1234", "user1@gmail.com", null, null, null);
user = User.of("ArticleServiceTestUser", "1234", "user1@gmail.com", null, null, "ArticleServiceTestUser");

user = userRepository.save(user);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class ChatroomServiceTest {

@BeforeEach
public void init() {
seller = User.of("user1", "password", "email1@", "oauthName1", null, null);
seller2 = User.of("seller2", "password", "seller2@", "seller2", null, null);
consumer = User.of("user2", "password", "email2@", "oauthName2", null, null);
seller = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
seller2 = User.of("seller2", "password", "seller2@", "seller2", null, "seller2");
consumer = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
seller = userRepository.save(seller);
seller2 = userRepository.save(seller2);
consumer = userRepository.save(consumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class OrderModuleServiceTest {

@BeforeEach
public void init() {
seller = User.of("user1", "password", "email1@", "oauthName1", null, null);
consumer = User.of("user2", "password", "email2@", "oauthName2", null, null);
other = User.of("user3", "password", "email3@", "oauthName3", null, null);
seller = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
consumer = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
other = User.of("user3", "password", "email3@", "oauthName3", null, "user3");
seller = userRepository.save(seller);
consumer = userRepository.save(consumer);
other = userRepository.save(other);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class OrderServiceTest {

@BeforeEach
public void init() {
seller = User.of("user1", "password", "email1@", "oauthName1", null, null);
consumer = User.of("user2", "password", "email2@", "oauthName2", null, null);
seller = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
consumer = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
seller = userRepository.save(seller);
consumer = userRepository.save(consumer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void initTestData() {
}

private User createAndSaveUser(String username, String email, String oauthName) {
User user = User.of(username, "password", email, oauthName, null, null);
User user = User.of(username, "password", email, oauthName, null, username);
return userRepository.save(user);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ class ReportModuleServiceTest {

@BeforeEach
public void init() {
reporter = User.of("reporter", "password", "email_reporter", "oauthName", null, null);
reporter = User.of("reporter", "password", "email_reporter", "oauthName", null, "reporter");
reporter = userRepository.save(reporter);

reportedUser = User.of("reported", "password", "email_reported", "oauthName", null, null);
reportedUser = User.of("reported", "password", "email_reported", "oauthName", null, "reported");
reportedUser = userRepository.save(reportedUser);

targetArticle = Article.builder().title("test article title")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public class ReportServiceTest {

@BeforeEach
public void init() {
reporter = User.of("reporter", "password", "email_reporter", "oauthName", null, null);
reporter = User.of("reporter", "password", "email_reporter", "oauthName", null, "reporter");
reporter = userRepository.save(reporter);

reportedUser = User.of("reported", "password", "email_reported", "oauthName", null, null);
reportedUser = User.of("reported", "password", "email_reported", "oauthName", null, "reported");
reportedUser = userRepository.save(reportedUser);

targetArticle = Article.builder().title("test article title")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public class ReviewModuleServiceTest {
@BeforeEach
public void init() {

reviewer1 = User.of("user1", "password", "email1@", "oauthName1", null, null);
reviewer1 = User.of("user1", "password", "email1@", "oauthName1", null, "user1");
reviewer1 = userRepository.save(reviewer1);

reviewer2 = User.of("user2", "password", "email2@", "oauthName2", null, null);
reviewer2 = User.of("user2", "password", "email2@", "oauthName2", null, "user2");
reviewer2 = userRepository.save(reviewer2);

User seller = User.of("seller", "password", "sellerEmail@", "sellerOauthName", null, null);
User seller = User.of("seller", "password", "sellerEmail@", "sellerOauthName", null, "seller");
seller = userRepository.save(seller);

article = Article.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ public static void afterAll() {

@BeforeEach
public void init() {
reviewer1 = User.of("user1", "password", "email1@", "oauthName1", "", null);
reviewer1 = User.of("user1", "password", "email1@", "oauthName1", "", "user1");
reviewer1 = userRepository.save(reviewer1);

reviewer2 = User.of("user2", "password", "email2@", "oauthName2", "", null);
reviewer2 = User.of("user2", "password", "email2@", "oauthName2", "", "user2");
reviewer2 = userRepository.save(reviewer2);

reviewer3 = User.of("user3", "password", "email3@", "oauthName3", "", null);
reviewer3 = User.of("user3", "password", "email3@", "oauthName3", "", "user3");
reviewer3 = userRepository.save(reviewer3);

reviewer4 = User.of("user4", "password", "email4@", "oauthName4", "", null);
reviewer4 = User.of("user4", "password", "email4@", "oauthName4", "", "user4");
reviewer4 = userRepository.save(reviewer4);

User seller = User.of("seller", "password", "sellerEmail@", "sellerOauthName", "", null);
User seller = User.of("seller", "password", "sellerEmail@", "sellerOauthName", "", "seller");
seller = userRepository.save(seller);

article = Article.builder()
Expand Down

0 comments on commit 7fe360c

Please sign in to comment.