1
1
namespace Ocelot . AcceptanceTests
2
2
{
3
- using Configuration . File ;
3
+ using Ocelot . Configuration . File ;
4
4
using Microsoft . AspNetCore . Http ;
5
5
using Newtonsoft . Json ;
6
6
using Steeltoe . Common . Discovery ;
@@ -38,24 +38,24 @@ public void should_use_eureka_service_discovery_and_make_request()
38
38
var configuration = new FileConfiguration
39
39
{
40
40
Routes = new List < FileRoute >
41
+ {
42
+ new FileRoute
41
43
{
42
- new FileRoute
43
- {
44
- DownstreamPathTemplate = "/" ,
45
- DownstreamScheme = "http" ,
46
- UpstreamPathTemplate = "/" ,
47
- UpstreamHttpMethod = new List < string > { "Get" } ,
48
- ServiceName = serviceName ,
49
- LoadBalancerOptions = new FileLoadBalancerOptions { Type = "LeastConnection" } ,
50
- }
44
+ DownstreamPathTemplate = "/" ,
45
+ DownstreamScheme = "http" ,
46
+ UpstreamPathTemplate = "/" ,
47
+ UpstreamHttpMethod = new List < string > { "Get" } ,
48
+ ServiceName = serviceName ,
49
+ LoadBalancerOptions = new FileLoadBalancerOptions { Type = "LeastConnection" } ,
51
50
} ,
51
+ } ,
52
52
GlobalConfiguration = new FileGlobalConfiguration ( )
53
53
{
54
54
ServiceDiscoveryProvider = new FileServiceDiscoveryProvider ( )
55
55
{
56
- Type = "Eureka"
57
- }
58
- }
56
+ Type = "Eureka" ,
57
+ } ,
58
+ } ,
59
59
} ;
60
60
61
61
this . Given ( x => x . GivenEurekaProductServiceOneIsRunning ( downstreamServiceOneUrl ) )
@@ -91,42 +91,42 @@ private void GivenThereIsAFakeEurekaServiceDiscoveryProvider(string url, string
91
91
{
92
92
name = serviceName ,
93
93
instance = new List < Instance >
94
+ {
95
+ new Instance
96
+ {
97
+ instanceId = $ "{ serviceInstance . Host } :{ serviceInstance } ",
98
+ hostName = serviceInstance . Host ,
99
+ app = serviceName ,
100
+ ipAddr = "127.0.0.1" ,
101
+ status = "UP" ,
102
+ overriddenstatus = "UNKNOWN" ,
103
+ port = new Port { value = serviceInstance . Port , enabled = "true" } ,
104
+ securePort = new SecurePort { value = serviceInstance . Port , enabled = "true" } ,
105
+ countryId = 1 ,
106
+ dataCenterInfo = new DataCenterInfo { value = "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo" , name = "MyOwn" } ,
107
+ leaseInfo = new LeaseInfo
108
+ {
109
+ renewalIntervalInSecs = 30 ,
110
+ durationInSecs = 90 ,
111
+ registrationTimestamp = 1457714988223 ,
112
+ lastRenewalTimestamp = 1457716158319 ,
113
+ evictionTimestamp = 0 ,
114
+ serviceUpTimestamp = 1457714988223 ,
115
+ } ,
116
+ metadata = new Metadata
94
117
{
95
- new Instance
96
- {
97
- instanceId = $ "{ serviceInstance . Host } :{ serviceInstance } ",
98
- hostName = serviceInstance . Host ,
99
- app = serviceName ,
100
- ipAddr = "127.0.0.1" ,
101
- status = "UP" ,
102
- overriddenstatus = "UNKNOWN" ,
103
- port = new Port { value = serviceInstance . Port , enabled = "true" } ,
104
- securePort = new SecurePort { value = serviceInstance . Port , enabled = "true" } ,
105
- countryId = 1 ,
106
- dataCenterInfo = new DataCenterInfo { value = "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo" , name = "MyOwn" } ,
107
- leaseInfo = new LeaseInfo
108
- {
109
- renewalIntervalInSecs = 30 ,
110
- durationInSecs = 90 ,
111
- registrationTimestamp = 1457714988223 ,
112
- lastRenewalTimestamp = 1457716158319 ,
113
- evictionTimestamp = 0 ,
114
- serviceUpTimestamp = 1457714988223
115
- } ,
116
- metadata = new Metadata
117
- {
118
- value = "java.util.Collections$EmptyMap"
119
- } ,
120
- homePageUrl = $ "{ serviceInstance . Host } :{ serviceInstance . Port } ",
121
- statusPageUrl = $ "{ serviceInstance . Host } :{ serviceInstance . Port } ",
122
- healthCheckUrl = $ "{ serviceInstance . Host } :{ serviceInstance . Port } ",
123
- vipAddress = serviceName ,
124
- isCoordinatingDiscoveryServer = "false" ,
125
- lastUpdatedTimestamp = "1457714988223" ,
126
- lastDirtyTimestamp = "1457714988172" ,
127
- actionType = "ADDED"
128
- }
129
- }
118
+ value = "java.util.Collections$EmptyMap" ,
119
+ } ,
120
+ homePageUrl = $ "{ serviceInstance . Host } :{ serviceInstance . Port } ",
121
+ statusPageUrl = $ "{ serviceInstance . Host } :{ serviceInstance . Port } ",
122
+ healthCheckUrl = $ "{ serviceInstance . Host } :{ serviceInstance . Port } ",
123
+ vipAddress = serviceName ,
124
+ isCoordinatingDiscoveryServer = "false" ,
125
+ lastUpdatedTimestamp = "1457714988223" ,
126
+ lastDirtyTimestamp = "1457714988172" ,
127
+ actionType = "ADDED" ,
128
+ } ,
129
+ } ,
130
130
} ;
131
131
132
132
apps . Add ( a ) ;
@@ -138,8 +138,8 @@ private void GivenThereIsAFakeEurekaServiceDiscoveryProvider(string url, string
138
138
{
139
139
application = apps ,
140
140
apps__hashcode = "UP_1_" ,
141
- versions__delta = "1"
142
- }
141
+ versions__delta = "1" ,
142
+ } ,
143
143
} ;
144
144
145
145
var json = JsonConvert . SerializeObject ( applications ) ;
0 commit comments