mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-05 17:47:36 +08:00
test: mock user controller dependencies
This commit is contained in:
@@ -2,6 +2,8 @@ package com.openisle.controller;
|
|||||||
|
|
||||||
import com.openisle.model.User;
|
import com.openisle.model.User;
|
||||||
import com.openisle.service.*;
|
import com.openisle.service.*;
|
||||||
|
import com.openisle.mapper.TagMapper;
|
||||||
|
import com.openisle.mapper.UserMapper;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -40,6 +42,14 @@ class UserControllerTest {
|
|||||||
private CommentService commentService;
|
private CommentService commentService;
|
||||||
@MockBean
|
@MockBean
|
||||||
private LevelService levelService;
|
private LevelService levelService;
|
||||||
|
@MockBean
|
||||||
|
private TagService tagService;
|
||||||
|
@MockBean
|
||||||
|
private JwtService jwtService;
|
||||||
|
@MockBean
|
||||||
|
private UserMapper userMapper;
|
||||||
|
@MockBean
|
||||||
|
private TagMapper tagMapper;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getCurrentUser() throws Exception {
|
void getCurrentUser() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user