Skip to content

Commit

Permalink
[Test]: Fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed Jul 21, 2024
1 parent 1585779 commit 092e12d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.haedal.zzansuni.domain.challengegroup.DayType;
import org.haedal.zzansuni.domain.challengegroup.challenge.*;
import org.haedal.zzansuni.domain.challengegroup.challenge.port.ChallengeReader;
import org.haedal.zzansuni.domain.userchallenge.AddUserExpByVerificationUseCase;
import org.haedal.zzansuni.domain.userchallenge.review.port.ChallengeReviewReader;
import org.haedal.zzansuni.domain.userchallenge.UserChallenge;
import org.haedal.zzansuni.domain.userchallenge.port.UserChallengeReader;
Expand Down Expand Up @@ -60,6 +61,9 @@ class UserChallengeServiceTest {
@Mock
private ChallengeGroupUserExpStore challengeGroupUserExpStore;

@Mock
private AddUserExpByVerificationUseCase addUserExpByVerificationUseCase;

@InjectMocks
private UserChallengeService userChallengeService;

Expand Down Expand Up @@ -167,9 +171,6 @@ void verification() {

when(userChallengeReader.getByChallengeIdWithVerificationAndChallenge(challengeId,
userId)).thenReturn(userChallenge);
when(challengeGroupReader.findByChallengeGroupIdAndUserId(challengeGroup.getId(),
userId)).thenReturn(Optional.of(challengeGroupUserExp));

ChallengeModel.ChallengeVerificationResult result = userChallengeService.verification(
challengeId, userId, command);

Expand All @@ -180,8 +181,6 @@ void verification() {

verify(userChallengeReader).getByChallengeIdWithVerificationAndChallenge(challengeId,
userId);
verify(challengeGroupReader).findByChallengeGroupIdAndUserId(challengeGroup.getId(),
userId);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.when;

@SpringBootTest

@ExtendWith(MockitoExtension.class)
public class UserServiceTest {
@InjectMocks
Expand Down

0 comments on commit 092e12d

Please sign in to comment.