diff --git a/src/main/java/gitbal/backend/global/mock/MockDataGenerator.java b/src/main/java/gitbal/backend/global/mock/MockDataGenerator.java index 69edee0..3eac5cf 100644 --- a/src/main/java/gitbal/backend/global/mock/MockDataGenerator.java +++ b/src/main/java/gitbal/backend/global/mock/MockDataGenerator.java @@ -86,14 +86,12 @@ public void run(String... args) throws Exception { // Test를 위한 나(이승준)의 githubid와 동일한 nickname data String lee = "leesj000603"; - String khyojun = "khyojun"; - if(userRepository.findByNickname(lee).isPresent() || userRepository.findByNickname(khyojun).isPresent()){ + if(userRepository.findByNickname(lee).isPresent()){ log.info("duplicate"); return; } createUserWithNickname(lee); - createUserWithNickname2(khyojun); userService.updateUserRank(); //user 순위 업데이트 userService.updateUserGrade(); // user 등급 업데이트 insertRegionSchoolTopContributorInfo(); @@ -102,34 +100,6 @@ public void run(String... args) throws Exception { log.info("Mock data creation completed!!!!!!"); } - private void createUserWithNickname2(String username) { - School school = schoolRepository.findById(1L) - .orElse(null); - Region region = regionRepository.findById(1L) - .orElse(null); - OneDayCommit oneDayCommit = OneDayCommit.of(true); - oneDayCommitRepository.save(oneDayCommit); - - - User khyojun = User.builder() - .school(school) - .region(region) - .nickname(username) - .score(500L) - .profile_img("sdqsdqwefqwef") - .grade(Grade.PURPLE) - .build(); - - List majorLanguages2 = createRandomMajorLanguagesForUser(khyojun); - majorLanguages2.forEach(majorLanguageRepository::save); - - OneDayCommit oneDayCommit2 = OneDayCommit.of(false); - oneDayCommitRepository.save(oneDayCommit2); - khyojun.joinUpdateUser(school, region, oneDayCommit2, majorLanguages2, - khyojun.getNickname(), khyojun.getScore(), khyojun.getProfile_img(), Grade.YELLOW, 0); - userRepository.save(khyojun); - - } private User createUser(String randomNickname, School school, Region region, int index) { diff --git a/src/main/java/gitbal/backend/schedule/userupdate/UserSetup.java b/src/main/java/gitbal/backend/schedule/userupdate/UserSetup.java index d1d8255..e4fb9c2 100644 --- a/src/main/java/gitbal/backend/schedule/userupdate/UserSetup.java +++ b/src/main/java/gitbal/backend/schedule/userupdate/UserSetup.java @@ -9,7 +9,7 @@ public abstract class UserSetup { protected List getAllUsernames(UserService userService){ //List allUserNames = userService.findAllUserNames(); // TODO : 임시로 진행하여 임의의 github id 로 등록 진행 - List allUserNames = List.of(userService.findByUserName("khyojun").getNickname(), + List allUserNames = List.of( userService.findByUserName("leesj000603").getNickname() ); return allUserNames;