DubboServiceTest.java
2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.Application;
import cn.hutool.json.JSONUtil;
import com.glsx.biz.common.base.entity.CarBrandSelected;
import com.glsx.biz.common.base.entity.Carbrand;
import com.glsx.biz.common.base.entity.Carseries;
import com.glsx.biz.common.base.entity.Cartype;
import com.glsx.biz.common.base.service.CarbrandService;
import com.glsx.biz.common.base.service.CarseriesService;
import com.glsx.biz.common.base.service.CartypeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.List;
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class DubboServiceTest {
@DubboReference(version = "2.2.0")
private CarbrandService carbrandService;
@DubboReference(version = "2.2.0")
private CarseriesService carseriesService;
@DubboReference(version = "2.2.0")
private CartypeService cartypeService;
@Test
public void getAllCarbrand() {
// List<Carbrand> carbrandList = carbrandService.getParentCarbrandList();
// System.out.println(JSONUtil.toJsonStr(carbrandList));
// List<Carbrand> carbrandList2 = carbrandService.listSubCarbrandByParentId(2165);
// System.out.println(JSONUtil.toJsonStr(carbrandList2));
// List<CarBrandSelected> carbrandList3 = carbrandService.getCarInfoCompleteForSelected();
List<CarBrandSelected> carbrandList4 = carbrandService.getFullCarInfoForSelected();
// System.out.println(JSONUtil.toJsonStr(carbrandList3));
System.out.println(JSONUtil.toJsonStr(carbrandList4));
// List<Carbrand> carbrandList22 = carbrandService.findByBraLetter("东风本田");
// List<Carbrand> carbrandList23 = carbrandService.findByName("东风本田");
// System.out.println(JSONUtil.toJsonStr(carbrandList22));
// System.out.println(JSONUtil.toJsonStr(carbrandList23));
}
@Test
public void getCarseries() {
List<Carseries> carseriesList = carseriesService.getByCarbrandId(2167);
System.out.println(JSONUtil.toJsonStr(carseriesList));
}
@Test
public void getCartype() {
List<Cartype> cartypeList = cartypeService.getBySeiesId(1145108);
System.out.println(JSONUtil.toJsonStr(cartypeList));
// Cartype cartype1 = cartypeService.getByCarTypeId(Math.toIntExact(43083L));
// System.out.println(111);
}
}