tsk-176: Fix after icarus_models change
This commit is contained in:
@@ -17,6 +17,7 @@ pub mod endpoints {
|
|||||||
|
|
||||||
pub const CREATESONG: &str = "/api/v2/song";
|
pub const CREATESONG: &str = "/api/v2/song";
|
||||||
pub const GETSONGS: &str = "/api/v2/song";
|
pub const GETSONGS: &str = "/api/v2/song";
|
||||||
|
pub const GETALLSONGS: &str = "/api/v2/song/all";
|
||||||
pub const STREAMSONG: &str = "/api/v2/song/stream/{id}";
|
pub const STREAMSONG: &str = "/api/v2/song/stream/{id}";
|
||||||
pub const DOWNLOADSONG: &str = "/api/v2/song/download/{id}";
|
pub const DOWNLOADSONG: &str = "/api/v2/song/download/{id}";
|
||||||
pub const DELETESONG: &str = "/api/v2/song/{id}";
|
pub const DELETESONG: &str = "/api/v2/song/{id}";
|
||||||
|
|||||||
+16
-3
@@ -341,10 +341,24 @@ mod tests {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
pub fn test_user_id() -> uuid::Uuid {
|
||||||
|
uuid::Uuid::new_v4()
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
pub const TEST_USER_ID: uuid::Uuid = uuid::uuid!("cc938368-615a-4694-b2ca-6e122fa31c52");
|
||||||
|
|
||||||
pub async fn test_token() -> Result<String, josekit::JoseError> {
|
pub async fn test_token() -> Result<String, josekit::JoseError> {
|
||||||
let key: String = icarus_envy::environment::get_secret_main_key().await;
|
let key: String = icarus_envy::environment::get_secret_main_key().await;
|
||||||
let (message, issuer, audience) = token_fields();
|
let (message, issuer, audience) = token_fields();
|
||||||
|
|
||||||
|
let token_resource = icarus_models::token::TokenResource {
|
||||||
|
message: message,
|
||||||
|
issuer: issuer,
|
||||||
|
audiences: vec![audience],
|
||||||
|
id: TEST_USER_ID,
|
||||||
|
};
|
||||||
|
|
||||||
match icarus_models::token::create_token(&key, &message, &issuer, &audience) {
|
match icarus_models::token::create_token(&key, &message, &issuer, &audience) {
|
||||||
Ok((access_token, _some_time)) => Ok(access_token),
|
Ok((access_token, _some_time)) => Ok(access_token),
|
||||||
Err(err) => Err(err),
|
Err(err) => Err(err),
|
||||||
@@ -607,9 +621,8 @@ mod tests {
|
|||||||
let song_queue_id = resp.data[0];
|
let song_queue_id = resp.data[0];
|
||||||
assert_eq!(false, song_queue_id.is_nil(), "Should not be empty");
|
assert_eq!(false, song_queue_id.is_nil(), "Should not be empty");
|
||||||
|
|
||||||
let user_id = uuid::Uuid::new_v4();
|
let user_id = TEST_USER_ID;
|
||||||
|
|
||||||
// match super::get_resp_data::<crate::callers::song::response::link_user_id::Response>(response).await {
|
|
||||||
|
|
||||||
match super::song_queue_link_req(&app, &song_queue_id, &user_id).await {
|
match super::song_queue_link_req(&app, &song_queue_id, &user_id).await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
@@ -876,7 +889,7 @@ mod tests {
|
|||||||
assert_eq!(false, resp.data[0].is_nil(), "Should not be empty");
|
assert_eq!(false, resp.data[0].is_nil(), "Should not be empty");
|
||||||
|
|
||||||
let song_queue_id = &resp.data[0];
|
let song_queue_id = &resp.data[0];
|
||||||
let user_id = uuid::Uuid::new_v4();
|
let user_id = TEST_USER_ID;
|
||||||
println!("User Id: {user_id:?}");
|
println!("User Id: {user_id:?}");
|
||||||
|
|
||||||
match song_queue_link_req(&app, &song_queue_id, &user_id).await {
|
match song_queue_link_req(&app, &song_queue_id, &user_id).await {
|
||||||
|
|||||||
Reference in New Issue
Block a user