-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from softeerbootcamp4th/test/arrival
[Test] arrival 퀴즈, 선착순 이벤트, 스케줄러 단위테스트 추가
- Loading branch information
Showing
18 changed files
with
561 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...uler/ArrivalEventMaxArrivalScheduler.java → ...uler/ArrivalEventMaxArrivalScheduler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
src/main/java/com/softeer/podoarrival/event/service/ArrivalEventService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/test/java/com/softeer/podoarrival/unit/base/ArrivalEventBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.softeer.podoarrival.unit.base; | ||
|
||
import com.softeer.podoarrival.event.model.entity.Role; | ||
import com.softeer.podoarrival.event.repository.ArrivalUserRepository; | ||
import com.softeer.podoarrival.event.service.ArrivalEventReleaseService; | ||
import com.softeer.podoarrival.security.AuthInfo; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import org.redisson.api.BatchResult; | ||
import org.redisson.api.RBatch; | ||
import org.redisson.api.RSetAsync; | ||
import org.redisson.api.RedissonClient; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
public class ArrivalEventBase { | ||
|
||
@Mock | ||
protected RedissonClient redissonClient; | ||
|
||
@Mock | ||
protected ArrivalUserRepository arrivalUserRepository; | ||
|
||
@Mock | ||
protected RBatch batch; | ||
|
||
@Mock | ||
protected RSetAsync<String> setAsync; | ||
|
||
@Mock | ||
protected BatchResult<Object> batchResult; | ||
|
||
@InjectMocks | ||
protected ArrivalEventReleaseService arrivalEventReleaseService; | ||
|
||
protected AuthInfo authInfo; | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
authInfo = new AuthInfo("user", "01012345678", Role.ROLE_USER); | ||
ArrivalEventReleaseService.setMaxArrival(5); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/test/java/com/softeer/podoarrival/unit/base/ArrivalEventMaxCountSchedulerBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.softeer.podoarrival.unit.base; | ||
|
||
import com.softeer.podoarrival.event.repository.EventRepository; | ||
import com.softeer.podoarrival.event.repository.EventRewardRepository; | ||
import com.softeer.podoarrival.event.repository.EventTypeRepository; | ||
import com.softeer.podoarrival.event.scheduler.ArrivalEventMaxArrivalScheduler; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
public class ArrivalEventMaxCountSchedulerBase { | ||
|
||
@Mock | ||
protected EventRepository eventRepository; | ||
|
||
@Mock | ||
protected EventRewardRepository eventRewardRepository; | ||
|
||
@Mock | ||
protected EventTypeRepository eventTypeRepository; | ||
|
||
@InjectMocks | ||
protected ArrivalEventMaxArrivalScheduler arrivalEventMaxArrivalScheduler; | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
} | ||
|
||
@AfterEach | ||
public void tearDown() { | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/test/java/com/softeer/podoarrival/unit/base/DailyQuizSchedulerBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.softeer.podoarrival.unit.base; | ||
|
||
import com.softeer.podoarrival.event.repository.QuizRepository; | ||
import com.softeer.podoarrival.event.repository.RedisRepository; | ||
import com.softeer.podoarrival.event.scheduler.DailyQuizScheduler; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
public class DailyQuizSchedulerBase { | ||
|
||
@Mock | ||
protected RedisRepository redisRepository; | ||
|
||
@Mock | ||
protected QuizRepository quizRepository; | ||
|
||
@InjectMocks | ||
protected DailyQuizScheduler quizScheduler; | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
} | ||
|
||
@AfterEach | ||
public void tearDown() { | ||
} | ||
} |
Oops, something went wrong.