File tree Expand file tree Collapse file tree 4 files changed +43
-17
lines changed
main/java/com/cevher/ms/cloud/gateway
test/java/com/cevher/ms/cloud/gateway Expand file tree Collapse file tree 4 files changed +43
-17
lines changed Original file line number Diff line number Diff line change 10
10
</parent >
11
11
<groupId >com.cevher.ms</groupId >
12
12
<artifactId >api-gateway</artifactId >
13
- <version >0.0.1-SNAPSHOT </version >
13
+ <version >0.0.3 </version >
14
14
<name >api-gateway</name >
15
15
<description >API Gateway Application</description >
16
16
<properties >
49
49
</exclusion >
50
50
</exclusions >
51
51
</dependency >
52
+ <dependency >
53
+ <groupId >junit</groupId >
54
+ <artifactId >junit</artifactId >
55
+ <scope >test</scope >
56
+ </dependency >
57
+
52
58
</dependencies >
53
59
<dependencyManagement >
54
60
<dependencies >
Original file line number Diff line number Diff line change @@ -8,15 +8,15 @@ public class FallBackController {
8
8
9
9
@ GetMapping ("/userServiceFallBack" )
10
10
public String userServiceFallBack (){
11
- return "FallBack Controller!.. User Service is taking longer then Expected." ;
11
+ return "FallBack User Controller!.. User Service is taking longer then Expected." ;
12
12
}
13
13
14
14
@ GetMapping ("/departmentServiceFallBack" )
15
15
public String departmentServiceFallBack (){
16
- return "FallBack Controller!.. Department Service is taking longer then Expected." ;
16
+ return "FallBack Department Controller!.. Department Service is taking longer then Expected." ;
17
17
}
18
18
@ GetMapping ("/taskServiceFallBack" )
19
19
public String taskServiceFallBack (){
20
- return "FallBack Controller!.. Task Service is taking longer then Expected." ;
20
+ return "FallBack Task Controller!.. Task Service is taking longer then Expected." ;
21
21
}
22
22
}
Original file line number Diff line number Diff line change
1
+ package com .cevher .ms .cloud .gateway ;
2
+
3
+ import org .junit .Ignore ;
4
+ import org .junit .jupiter .api .Test ;
5
+ import org .springframework .beans .factory .annotation .Autowired ;
6
+ import org .springframework .boot .test .context .SpringBootTest ;
7
+ import org .springframework .boot .test .web .client .TestRestTemplate ;
8
+ import org .springframework .boot .web .server .LocalServerPort ;
9
+
10
+ import static org .assertj .core .api .Assertions .assertThat ;
11
+
12
+ @ SpringBootTest (webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT )
13
+ class APIGatewayApplicationTests {
14
+
15
+ @ LocalServerPort
16
+ private int port ;
17
+
18
+ @ Autowired
19
+ private TestRestTemplate restTemplate ;
20
+
21
+ @ Test
22
+ void contextLoads () {
23
+ }
24
+
25
+ @ Ignore ("not yet ready , Please ignore." )
26
+ @ Test
27
+ void fallBackUser () throws Exception {
28
+ assertThat (this .restTemplate
29
+ .getForObject ("http://127.0.0.1:" + port + "/userServiceFallBack" , String .class )
30
+ ).contains ("FallBack User Controller" );
31
+ }
32
+
33
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments