tests passing

This commit is contained in:
TomPallister 2020-11-30 11:27:37 +00:00
parent 32551624bb
commit 17b0555f55
4 changed files with 368 additions and 367 deletions

View File

@ -28,6 +28,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.0.1" /> <PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.0.1" />
<PackageReference Include="Steeltoe.Discovery.Eureka" Version="3.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164"> <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View File

@ -1,6 +1,6 @@
namespace Ocelot.AcceptanceTests namespace Ocelot.AcceptanceTests
{ {
using Configuration.File; using Ocelot.Configuration.File;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Newtonsoft.Json; using Newtonsoft.Json;
using Steeltoe.Common.Discovery; using Steeltoe.Common.Discovery;
@ -38,24 +38,24 @@
var configuration = new FileConfiguration var configuration = new FileConfiguration
{ {
Routes = new List<FileRoute> Routes = new List<FileRoute>
{
new FileRoute
{ {
new FileRoute DownstreamPathTemplate = "/",
{ DownstreamScheme = "http",
DownstreamPathTemplate = "/", UpstreamPathTemplate = "/",
DownstreamScheme = "http", UpstreamHttpMethod = new List<string> { "Get" },
UpstreamPathTemplate = "/", ServiceName = serviceName,
UpstreamHttpMethod = new List<string> { "Get" }, LoadBalancerOptions = new FileLoadBalancerOptions { Type = "LeastConnection" },
ServiceName = serviceName,
LoadBalancerOptions = new FileLoadBalancerOptions { Type = "LeastConnection" },
}
}, },
},
GlobalConfiguration = new FileGlobalConfiguration() GlobalConfiguration = new FileGlobalConfiguration()
{ {
ServiceDiscoveryProvider = new FileServiceDiscoveryProvider() ServiceDiscoveryProvider = new FileServiceDiscoveryProvider()
{ {
Type = "Eureka" Type = "Eureka",
} },
} },
}; };
this.Given(x => x.GivenEurekaProductServiceOneIsRunning(downstreamServiceOneUrl)) this.Given(x => x.GivenEurekaProductServiceOneIsRunning(downstreamServiceOneUrl))
@ -91,42 +91,42 @@
{ {
name = serviceName, name = serviceName,
instance = new List<Instance> instance = new List<Instance>
{
new Instance
{
instanceId = $"{serviceInstance.Host}:{serviceInstance}",
hostName = serviceInstance.Host,
app = serviceName,
ipAddr = "127.0.0.1",
status = "UP",
overriddenstatus = "UNKNOWN",
port = new Port {value = serviceInstance.Port, enabled = "true"},
securePort = new SecurePort {value = serviceInstance.Port, enabled = "true"},
countryId = 1,
dataCenterInfo = new DataCenterInfo {value = "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo", name = "MyOwn"},
leaseInfo = new LeaseInfo
{ {
new Instance renewalIntervalInSecs = 30,
{ durationInSecs = 90,
instanceId = $"{serviceInstance.Host}:{serviceInstance}", registrationTimestamp = 1457714988223,
hostName = serviceInstance.Host, lastRenewalTimestamp= 1457716158319,
app = serviceName, evictionTimestamp = 0,
ipAddr = "127.0.0.1", serviceUpTimestamp = 1457714988223,
status = "UP", },
overriddenstatus = "UNKNOWN", metadata = new Metadata
port = new Port {value = serviceInstance.Port, enabled = "true"}, {
securePort = new SecurePort {value = serviceInstance.Port, enabled = "true"}, value = "java.util.Collections$EmptyMap",
countryId = 1, },
dataCenterInfo = new DataCenterInfo {value = "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo", name = "MyOwn"}, homePageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
leaseInfo = new LeaseInfo statusPageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
{ healthCheckUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
renewalIntervalInSecs = 30, vipAddress = serviceName,
durationInSecs = 90, isCoordinatingDiscoveryServer = "false",
registrationTimestamp = 1457714988223, lastUpdatedTimestamp = "1457714988223",
lastRenewalTimestamp= 1457716158319, lastDirtyTimestamp = "1457714988172",
evictionTimestamp = 0, actionType = "ADDED",
serviceUpTimestamp = 1457714988223 },
}, },
metadata = new Metadata
{
value = "java.util.Collections$EmptyMap"
},
homePageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
statusPageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
healthCheckUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
vipAddress = serviceName,
isCoordinatingDiscoveryServer = "false",
lastUpdatedTimestamp = "1457714988223",
lastDirtyTimestamp = "1457714988172",
actionType = "ADDED"
}
}
}; };
apps.Add(a); apps.Add(a);
@ -138,8 +138,8 @@
{ {
application = apps, application = apps,
apps__hashcode = "UP_1_", apps__hashcode = "UP_1_",
versions__delta = "1" versions__delta = "1",
} },
}; };
var json = JsonConvert.SerializeObject(applications); var json = JsonConvert.SerializeObject(applications);