File tree Expand file tree Collapse file tree 4 files changed +20
-25
lines changed Expand file tree Collapse file tree 4 files changed +20
-25
lines changed Original file line number Diff line number Diff line change 11[package ]
2- name = " zenith- builder-example "
2+ name = " builder"
33version = " 0.1.1"
4- description = " Zenith Builder Example "
4+ description = " signet builder example "
55
66edition = " 2024"
77rust-version = " 1.85"
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ impl Authenticator {
8080 }
8181
8282 /// Fetches an oauth token
83- async fn fetch_oauth_token ( & self ) -> eyre:: Result < Token > {
83+ pub async fn fetch_oauth_token ( & self ) -> eyre:: Result < Token > {
8484 let token_result =
8585 self . client . exchange_client_credentials ( ) . request_async ( async_http_client) . await ?;
8686
@@ -109,23 +109,3 @@ impl Authenticator {
109109 handle
110110 }
111111}
112-
113- mod tests {
114- #[ ignore = "integration test" ]
115- #[ tokio:: test]
116- async fn test_authenticator ( ) -> eyre:: Result < ( ) > {
117- use super :: * ;
118- use crate :: test_utils:: setup_test_config;
119- use oauth2:: TokenResponse ;
120-
121- let config = setup_test_config ( ) ?;
122- let auth = Authenticator :: new ( & config) ;
123-
124- let _ = auth. fetch_oauth_token ( ) . await ?;
125-
126- let token = auth. token ( ) . await . unwrap ( ) ;
127-
128- assert ! ( !token. access_token( ) . secret( ) . is_empty( ) ) ;
129- Ok ( ( ) )
130- }
131- }
Original file line number Diff line number Diff line change 1+ use builder:: { tasks:: oauth:: Authenticator , test_utils:: setup_test_config} ;
2+
3+ #[ ignore = "integration test" ]
4+ #[ tokio:: test]
5+ async fn test_authenticator ( ) -> eyre:: Result < ( ) > {
6+ let config = setup_test_config ( ) ?;
7+ let auth = Authenticator :: new ( & config) ?;
8+
9+ let _ = auth. fetch_oauth_token ( ) . await ?;
10+
11+ let token = auth. token ( ) ;
12+
13+ assert ! ( token. is_authenticated( ) ) ;
14+ Ok ( ( ) )
15+ }
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ mod tests {
66 #[ tokio:: test]
77 async fn test_bundle_poller_roundtrip ( ) -> Result < ( ) > {
88 let config = test_utils:: setup_test_config ( ) . unwrap ( ) ;
9- let auth = Authenticator :: new ( & config) ;
9+ let auth = Authenticator :: new ( & config) ? ;
1010
11- let mut bundle_poller = builder:: tasks:: bundler:: BundlePoller :: new ( & config, auth) ;
11+ let mut bundle_poller = builder:: tasks:: bundler:: BundlePoller :: new ( & config, auth. token ( ) ) ;
1212
1313 let _ = bundle_poller. check_bundle_cache ( ) . await ?;
1414
You can’t perform that action at this time.
0 commit comments