- chore: ran cargo fix on the codebase
This commit is contained in:
@@ -3,12 +3,11 @@ mod tests {
|
||||
use dotenv::dotenv;
|
||||
// use auth_service::mocks::database_client_mock::MockDatabaseClient;
|
||||
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_login() {
|
||||
// dotenv().ok();
|
||||
// let mut db_client = MockDatabaseClient::new();
|
||||
//
|
||||
//
|
||||
// db_client
|
||||
// .expect_get_user_by_username()
|
||||
// .with(mockall::predicate::eq("test"))
|
||||
@@ -20,21 +19,21 @@ mod tests {
|
||||
// hashed_password: "test".to_string(),
|
||||
// })
|
||||
// });
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// let auth_service = MyAuthService {
|
||||
// db_client,
|
||||
// };
|
||||
//
|
||||
//
|
||||
// // Create a test LoginRequest
|
||||
// let request = Request::new(LoginRequest {
|
||||
// username: "test".into(),
|
||||
// password: "test".into(),
|
||||
// });
|
||||
//
|
||||
//
|
||||
// // Call the login method
|
||||
// let response = auth_service.login(request).await.unwrap().into_inner();
|
||||
//
|
||||
//
|
||||
// // Verify the response
|
||||
// assert!(!response.token.is_empty());
|
||||
// assert_eq!(response.user_id, "1"); // Replace with the expected user ID
|
||||
@@ -45,22 +44,22 @@ mod tests {
|
||||
dotenv().ok();
|
||||
// let addr = std::env::var("DATABASE_SERVICE_ADDR").unwrap_or_else(|_| "127.0.0.1:50052".to_string());
|
||||
// let db_client = DatabaseClient::connect(&addr).await.unwrap();
|
||||
//
|
||||
//
|
||||
// let auth_service = MyAuthService {
|
||||
// db_client,
|
||||
// };
|
||||
//
|
||||
//
|
||||
// // Generate a token for testing
|
||||
// let token = jwt::generate_token("123", Vec::from(["".to_string()])).unwrap();
|
||||
//
|
||||
//
|
||||
// // Create a ValidateTokenRequest
|
||||
// let request = Request::new(ValidateTokenRequest { token });
|
||||
//
|
||||
//
|
||||
// // Call the validate_token method
|
||||
// let response = auth_service.validate_token(request).await.unwrap().into_inner();
|
||||
//
|
||||
//
|
||||
// // Verify the response
|
||||
// assert!(response.valid);
|
||||
// assert_eq!(response.user_id, "123");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user