This commit is contained in:
@@ -40,8 +40,14 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTExpiredTokenShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "EXPIRED"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
|
||||
ApiResponse a = await Util.GetAsync("BuildMode");
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "EXPIRED"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -50,8 +56,13 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTWrongIssuerShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_ISSUER"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
ApiResponse a = await Util.GetAsync("BuildMode");
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_ISSUER"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -60,8 +71,13 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTNoAlgorithmShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "NO_ALGORITHM"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
ApiResponse a = await Util.GetAsync("BuildMode");
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "NO_ALGORITHM"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,8 +86,13 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTBadSecretShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_SECRET"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
ApiResponse a = await Util.GetAsync("BuildMode");
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_SECRET"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +102,13 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTTruncatedSignatureShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "TRUNCATED_SIGNATURE"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
ApiResponse a = await Util.GetAsync("BuildMode");
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "TRUNCATED_SIGNATURE"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,8 +118,13 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTTransposedSignatureShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "TRANSPOSE_SIGNATURE"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
ApiResponse a = await Util.GetAsync("BuildMode");
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
a = await Util.GetAsync("Locale/picklist", await Util.GetTokenAsync("INTEGRATION_TEST", "TRANSPOSE_SIGNATURE"));
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
4
util.cs
4
util.cs
@@ -24,8 +24,8 @@ namespace raven_integration
|
||||
|
||||
private static HttpClient client { get; } = new HttpClient();
|
||||
|
||||
private static string API_BASE_URL = "http://localhost:7575/api/v8.0/";
|
||||
//private static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
// public static string API_BASE_URL = "http://localhost:7575/api/v8.0/";
|
||||
public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
|
||||
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user