-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLrpcExampleApplicationTests.java
More file actions
34 lines (28 loc) · 1.07 KB
/
Copy pathLrpcExampleApplicationTests.java
File metadata and controls
34 lines (28 loc) · 1.07 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
package lrpc_example;
import cn.jgzhan.lrpc.springboot.annotation.LrpcReference;
import cn.jgzhan.lrpc.common.config.LrpcProperties;
import cn.jgzhan.lrpc.example.LrpcExampleApplication;
import cn.jgzhan.lrpc.example.api.TestService;
import cn.jgzhan.lrpc.example.service.HelloService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(classes = LrpcExampleApplication.class)
class LrpcExampleApplicationTests {
// @Autowired
@LrpcReference
private HelloService helloService;
@LrpcReference
private TestService testService;
@Autowired
private LrpcProperties lrpcProperties;
@Test
void contextLoads() throws InterruptedException {
for (int i = 0; i < 50; i++) {
Thread.sleep(1000);
// System.out.println(exampleService.call("jgzhan" + i));
System.out.println(helloService.sayHello("jgzhan" + i));
// System.out.println(testService.hello("jgzhan" + i));
}
}
}