add file configuration fluent validation and change default configura… (#168)

* add file configuration fluent validation and change default configuration validator to fluent validator

* add file validation failed error code

* change authentication schemes check to async

* beautify the code ^_^

* clean file validation and fix test failure.
This commit is contained in:
Eilyyyy
2017-12-05 12:29:44 -06:00
committed by Tom Pallister
parent 31fe6af614
commit 4f27a50503
18 changed files with 160 additions and 298 deletions

View File

@ -54,6 +54,7 @@ namespace Ocelot.UnitTests.Responder
[InlineData(OcelotErrorCode.DownstreampathTemplateAlreadyUsedError)]
[InlineData(OcelotErrorCode.DownstreamPathTemplateContainsSchemeError)]
[InlineData(OcelotErrorCode.DownstreamSchemeNullOrEmptyError)]
[InlineData(OcelotErrorCode.FileValidationFailedError)]
[InlineData(OcelotErrorCode.InstructionNotForClaimsError)]
[InlineData(OcelotErrorCode.NoInstructionsError)]
[InlineData(OcelotErrorCode.ParsingConfigurationHeaderError)]
@ -120,7 +121,7 @@ namespace Ocelot.UnitTests.Responder
// If this test fails then it's because the number of error codes has changed.
// You should make the appropriate changes to the test cases here to ensure
// they cover all the error codes, and then modify this assertion.
Enum.GetNames(typeof(OcelotErrorCode)).Length.ShouldBe(31, "Looks like the number of error codes has changed. Do you need to modify ErrorsToHttpStatusCodeMapper?");
Enum.GetNames(typeof(OcelotErrorCode)).Length.ShouldBe(32, "Looks like the number of error codes has changed. Do you need to modify ErrorsToHttpStatusCodeMapper?");
}
private void ShouldMapErrorToStatusCode(OcelotErrorCode errorCode, HttpStatusCode expectedHttpStatusCode)