diff --git a/build.cake b/build.cake index 6141ee21..20d40a4e 100644 --- a/build.cake +++ b/build.cake @@ -298,34 +298,42 @@ Task("DownloadGitHubReleaseArtifacts") .IsDependentOn("UpdateVersionInfo") .Does(() => { - Information("DownloadGitHubReleaseArtifacts"); + try + { + Information("DownloadGitHubReleaseArtifacts"); - EnsureDirectoryExists(packagesDir); + EnsureDirectoryExists(packagesDir); - Information("Directory exists..."); + Information("Directory exists..."); - var releaseUrl = tagsUrl + releaseTag; + var releaseUrl = tagsUrl + releaseTag; - Information("Release url " + releaseUrl); + Information("Release url " + releaseUrl); - var assets_url = ParseJson(GetResource(releaseUrl)) - .GetValue("assets_url") - .Value(); + var assets_url = ParseJson(GetResource(releaseUrl)) + .GetValue("assets_url") + .Value(); - Information("Assets url " + assets_url); + Information("Assets url " + assets_url); - foreach(var asset in DeserializeJson(GetResource(assets_url))) - { - Information("In the loop.."); + foreach(var asset in DeserializeJson(GetResource(assets_url))) + { + Information("In the loop.."); - var file = packagesDir + File(asset.Value("name")); + var file = packagesDir + File(asset.Value("name")); - Information("Downloading " + file); - - DownloadFile(asset.Value("browser_download_url"), file); - } + Information("Downloading " + file); + + DownloadFile(asset.Value("browser_download_url"), file); + } - Information("Out of the loop..."); + Information("Out of the loop..."); + } + catch(Exception exception) + { + Information("There was an exception " + exception); + throw; + } }); Task("ReleasePackagesToStableFeed") diff --git a/test/Ocelot.AcceptanceTests/RoutingTests.cs b/test/Ocelot.AcceptanceTests/RoutingTests.cs index fbdf57e1..648cbd71 100644 --- a/test/Ocelot.AcceptanceTests/RoutingTests.cs +++ b/test/Ocelot.AcceptanceTests/RoutingTests.cs @@ -61,6 +61,47 @@ namespace Ocelot.AcceptanceTests .BDDfy(); } + [Fact] + public void bug() + { + var configuration = new FileConfiguration + { + ReRoutes = new List + { + new FileReRoute + { + DownstreamPathTemplate = "/api/v1/vacancy", + DownstreamScheme = "http", + DownstreamHost = "localhost", + DownstreamPort = 51879, + UpstreamPathTemplate = "/vacancy/", + UpstreamHttpMethod = new List { "Options", "Put", "Get", "Post", "Delete" }, + ServiceName = "botCore", + LoadBalancer = "LeastConnection" + }, + new FileReRoute + { + DownstreamPathTemplate = "/api/v1/vacancy/{vacancyId}", + DownstreamScheme = "http", + DownstreamHost = "localhost", + DownstreamPort = 51879, + UpstreamPathTemplate = "/vacancy/{vacancyId}", + UpstreamHttpMethod = new List { "Options", "Put", "Get", "Post", "Delete" }, + ServiceName = "botCore", + LoadBalancer = "LeastConnection" + } + } + }; + + this.Given(x => x.GivenThereIsAServiceRunningOn("http://localhost:51879/api/v1/vacancy/1", 200, "Hello from Laura")) + .And(x => _steps.GivenThereIsAConfiguration(configuration)) + .And(x => _steps.GivenOcelotIsRunning()) + .When(x => _steps.WhenIGetUrlOnTheApiGateway("/vacancy/1")) + .Then(x => _steps.ThenTheStatusCodeShouldBe(HttpStatusCode.OK)) + .And(x => _steps.ThenTheResponseBodyShouldBe("Hello from Laura")) + .BDDfy(); + } + [Fact] public void should_return_response_200_when_path_missing_forward_slash_as_first_char() {