Skip to content

Commit

Permalink
add test for test signature endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tl-mingrui-huang committed Apr 13, 2023
1 parent e85cb7a commit 9160039
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/common/mock_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ impl TrueLayerMockServer {
web::resource("/payments-provider-return")
.route(web::post().to(routes::submit_provider_return_parameters)),
)
.service(
web::resource("/v1/test-signature")
.route(web::post().to(routes::test_signature)),
)
})
.workers(1)
.bind("127.0.0.1:0")
Expand Down
7 changes: 6 additions & 1 deletion tests/common/mock_server/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::common::mock_server::{
};
use actix_web::{web, HttpResponse};
use chrono::offset::Utc;
use serde_json::json;
use serde_json::{json, value::Value as JsonValue};
use truelayer_rust::apis::{
auth::Credentials,
merchant_accounts::{
Expand Down Expand Up @@ -793,3 +793,8 @@ pub(super) async fn submit_provider_return_parameters(
}
}))
}

/// POST /v1/test-signature
pub(super) async fn test_signature(_req: web::Json<JsonValue>) -> HttpResponse {
HttpResponse::NoContent().finish()
}
1 change: 1 addition & 0 deletions tests/integration_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ mod payments;
mod payments_providers;
mod payouts;
mod refunds;
mod stablecoin;
10 changes: 10 additions & 0 deletions tests/integration_tests/stablecoin.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::common::test_context::TestContext;

#[tokio::test]
async fn valid_test_signature_success() {
let ctx = TestContext::start().await;

let res = ctx.client.stablecoin.test_signature().await;

assert!(res.is_ok());
}

0 comments on commit 9160039

Please sign in to comment.