Feature/removed consul and its deps to other package (#539)

* #529 removed consul deps and introduced delegate to find service discovery provider

* +semver: breaking moved consul configuration to package..introduced mechanism for packages to configure Ocelot pipeline
This commit is contained in:
Tom Pallister
2018-08-12 17:28:41 +05:30
committed by GitHub
parent a91235b405
commit 87348e5d1b
11 changed files with 58 additions and 92 deletions

View File

@ -71,7 +71,7 @@ namespace Ocelot.UnitTests.Configuration
}
};
this.Given(x => WhenTheConfigIsChangedInConsul(newConfig, 0))
this.Given(x => WhenTheConfigIsChanged(newConfig, 0))
.Then(x => ThenTheSetterIsCalledAtLeast(newConfig, 1))
.BDDfy();
}
@ -96,13 +96,13 @@ namespace Ocelot.UnitTests.Configuration
}
};
this.Given(x => WhenTheConfigIsChangedInConsul(newConfig, 10))
this.Given(x => WhenTheConfigIsChanged(newConfig, 10))
.Then(x => ThenTheSetterIsCalled(newConfig, 1))
.BDDfy();
}
[Fact]
public void should_do_nothing_if_call_to_consul_fails()
public void should_do_nothing_if_call_to_provider_fails()
{
var newConfig = new FileConfiguration
{
@ -121,19 +121,19 @@ namespace Ocelot.UnitTests.Configuration
}
};
this.Given(x => WhenConsulErrors())
this.Given(x => WhenProviderErrors())
.Then(x => ThenTheSetterIsCalled(newConfig, 0))
.BDDfy();
}
private void WhenConsulErrors()
private void WhenProviderErrors()
{
_repo
.Setup(x => x.Get())
.ReturnsAsync(new ErrorResponse<FileConfiguration>(new AnyError()));
}
private void WhenTheConfigIsChangedInConsul(FileConfiguration newConfig, int delay)
private void WhenTheConfigIsChanged(FileConfiguration newConfig, int delay)
{
_repo
.Setup(x => x.Get())