diff --git a/src/test/java/com/umc/yourweather/domain/StatisticCreatorTest.java b/src/test/java/com/umc/yourweather/domain/StatisticCreatorTest.java index 9f20814f..8f223040 100644 --- a/src/test/java/com/umc/yourweather/domain/StatisticCreatorTest.java +++ b/src/test/java/com/umc/yourweather/domain/StatisticCreatorTest.java @@ -1,75 +1,75 @@ -package com.umc.yourweather.domain; - -import static org.junit.jupiter.api.Assertions.*; - -import com.umc.yourweather.domain.entity.User; -import com.umc.yourweather.repository.MemoRepository; -import com.umc.yourweather.repository.test.MemoTestRepository; -import com.umc.yourweather.response.StatisticResponseDto; -import java.time.LocalDateTime; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - - - -class StatisticCreatorTest { - - MemoRepository memoRepository = new MemoTestRepository(7); - - @BeforeEach - public void setMemoRepository() { - memoRepository = new MemoTestRepository(7); - } - - @Test - @DisplayName("주간 통계 수치화 테스트") - public void test1() { - // given - StatisticCreator statisticCreator = new StatisticCreator(memoRepository); - User user = User.builder() - .email("sbs8239@gmail.com") - .build(); - - // when - Statistic weeklyStatistic = statisticCreator.createWeeklyStatistic(user, LocalDateTime.now()); - StatisticResponseDto statisticResponseDto = new StatisticResponseDto(weeklyStatistic); - int sum = Math.round(statisticResponseDto.getSunny() + - statisticResponseDto.getCloudy() + - statisticResponseDto.getRainy() + - statisticResponseDto.getLightning()); - - // then - System.out.println(weeklyStatistic); - System.out.println(statisticResponseDto.toString()); - - assertEquals(weeklyStatistic.getSum(), 7); - assertEquals(100, sum); - } - - @Test - @DisplayName("월간 통계 수치화 테스트") - public void test2() { - // given - memoRepository = new MemoTestRepository(31); - StatisticCreator statisticCreator = new StatisticCreator(memoRepository); - User user = User.builder() - .email("sbs8239@gmail.com") - .build(); - - // when - Statistic weeklyStatistic = statisticCreator.createWeeklyStatistic(user, LocalDateTime.now()); - StatisticResponseDto statisticResponseDto = new StatisticResponseDto(weeklyStatistic); - int sum = Math.round(statisticResponseDto.getSunny() + - statisticResponseDto.getCloudy() + - statisticResponseDto.getRainy() + - statisticResponseDto.getLightning()); - - // then - System.out.println(weeklyStatistic); - System.out.println(statisticResponseDto.toString()); - - assertEquals(weeklyStatistic.getSum(), 31); - assertEquals(100, sum); - } -} \ No newline at end of file +//package com.umc.yourweather.domain; +// +//import static org.junit.jupiter.api.Assertions.*; +// +//import com.umc.yourweather.domain.entity.User; +//import com.umc.yourweather.repository.MemoRepository; +//import com.umc.yourweather.repository.test.MemoTestRepository; +//import com.umc.yourweather.response.StatisticResponseDto; +//import java.time.LocalDateTime; +//import org.junit.jupiter.api.BeforeEach; +//import org.junit.jupiter.api.DisplayName; +//import org.junit.jupiter.api.Test; +// +// +// +//class StatisticCreatorTest { +// +// MemoRepository memoRepository = new MemoTestRepository(7); +// +// @BeforeEach +// public void setMemoRepository() { +// memoRepository = new MemoTestRepository(7); +// } +// +// @Test +// @DisplayName("주간 통계 수치화 테스트") +// public void test1() { +// // given +// StatisticCreator statisticCreator = new StatisticCreator(memoRepository); +// User user = User.builder() +// .email("sbs8239@gmail.com") +// .build(); +// +// // when +// Statistic weeklyStatistic = statisticCreator.createWeeklyStatistic(user, LocalDateTime.now()); +// StatisticResponseDto statisticResponseDto = new StatisticResponseDto(weeklyStatistic); +// int sum = Math.round(statisticResponseDto.getSunny() + +// statisticResponseDto.getCloudy() + +// statisticResponseDto.getRainy() + +// statisticResponseDto.getLightning()); +// +// // then +// System.out.println(weeklyStatistic); +// System.out.println(statisticResponseDto.toString()); +// +// assertEquals(weeklyStatistic.getSum(), 7); +// assertEquals(100, sum); +// } +// +// @Test +// @DisplayName("월간 통계 수치화 테스트") +// public void test2() { +// // given +// memoRepository = new MemoTestRepository(31); +// StatisticCreator statisticCreator = new StatisticCreator(memoRepository); +// User user = User.builder() +// .email("sbs8239@gmail.com") +// .build(); +// +// // when +// Statistic weeklyStatistic = statisticCreator.createWeeklyStatistic(user, LocalDateTime.now()); +// StatisticResponseDto statisticResponseDto = new StatisticResponseDto(weeklyStatistic); +// int sum = Math.round(statisticResponseDto.getSunny() + +// statisticResponseDto.getCloudy() + +// statisticResponseDto.getRainy() + +// statisticResponseDto.getLightning()); +// +// // then +// System.out.println(weeklyStatistic); +// System.out.println(statisticResponseDto.toString()); +// +// assertEquals(weeklyStatistic.getSum(), 31); +// assertEquals(100, sum); +// } +//} \ No newline at end of file diff --git a/src/test/java/com/umc/yourweather/service/test/EmailTestService.java b/src/test/java/com/umc/yourweather/service/test/EmailTestService.java index 31016de4..6ed5043d 100644 --- a/src/test/java/com/umc/yourweather/service/test/EmailTestService.java +++ b/src/test/java/com/umc/yourweather/service/test/EmailTestService.java @@ -1,14 +1,14 @@ -package com.umc.yourweather.service.test; - -import com.umc.yourweather.repository.EmailCodeRepository; -import com.umc.yourweather.service.EmailService; -import org.springframework.mail.javamail.JavaMailSender; - -public class EmailTestService extends EmailService { - - public EmailTestService( - JavaMailSender emailSender, - EmailCodeRepository emailCodeRepository) { - super(emailSender, emailCodeRepository); - } -} +//package com.umc.yourweather.service.test; +// +//import com.umc.yourweather.repository.EmailCodeRepository; +//import com.umc.yourweather.service.EmailService; +//import org.springframework.mail.javamail.JavaMailSender; +// +//public class EmailTestService extends EmailService { +// +// public EmailTestService( +// JavaMailSender emailSender, +// EmailCodeRepository emailCodeRepository) { +// super(emailSender, emailCodeRepository); +// } +//}