package com.nuonuo.tax.web.service.form;
import com.nuonuo.tax.BaseTests;
import com.nuonuo.tax.MockWithAopHelper;
import com.nuonuo.tax.common.enums.base.ResponseMsgEnum;
import com.nuonuo.tax.common.enums.form.FormTypeEnums;
import com.nuonuo.tax.common.exception.BizException;
import com.nuonuo.tax.common.utils.DateUtil;
import com.nuonuo.tax.dao.mapper.form.GenFormMapper;
import com.nuonuo.tax.dao.po.form.GenFormPo;
import com.nuonuo.tax.dao.po.form.LogPo;
import com.nuonuo.tax.web.request.form.FormQueryRequest;
import com.nuonuo.tax.web.service.file.impl.CephFileServiceImpl;
import com.nuonuo.tax.web.vo.form.FormForCopyVO;
import com.nuonuo.tax.web.vo.form.FormForSaveVO;
import com.nuonuo.tax.web.vo.form.FormRequstForCopyVO;
import com.nuonuo.tax.web.vo.form.FormRequstForInsertVO;
import com.nuonuo.tax.web.vo.form.FormVO;
import com.nuonuo.tax.web.vo.form.FormVersionVo;
import com.nuonuo.tax.web.vo.form.LogVO;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Resource;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.web.client.RestTemplate;
/**
* @author lupengcheng
* @version 1.0
* @description FormServiceTest
* @date 2022/5/19 15:40
*/
public class GenFormServiceTest extends BaseTests {
@InjectMocks
@Autowired
private CephFileServiceImpl fileService;
@Mock
private RestTemplate restTemplate;
@Resource
GenFormServiceImpl genFormMangeService;
@Resource
GenFormMapper genFormMapper;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
//因为这些对象由spring代为管理,需要将对象中属性替换
MockWithAopHelper.setMocks(fileService, "restTemplate", restTemplate);
}
@Test
public void queryTest() {
FormQueryRequest request = new FormQueryRequest();
request.setArea("110000");
reques
关于mock第三方调用
最新推荐文章于 2025-03-11 08:56:06 发布
