File tree 4 files changed +20
-25
lines changed
4 files changed +20
-25
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
- name = " zenith- builder-example "
2
+ name = " builder"
3
3
version = " 0.1.1"
4
- description = " Zenith Builder Example "
4
+ description = " signet builder example "
5
5
6
6
edition = " 2024"
7
7
rust-version = " 1.85"
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ impl Authenticator {
80
80
}
81
81
82
82
/// 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 > {
84
84
let token_result =
85
85
self . client . exchange_client_credentials ( ) . request_async ( async_http_client) . await ?;
86
86
@@ -109,23 +109,3 @@ impl Authenticator {
109
109
handle
110
110
}
111
111
}
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 {
6
6
#[ tokio:: test]
7
7
async fn test_bundle_poller_roundtrip ( ) -> Result < ( ) > {
8
8
let config = test_utils:: setup_test_config ( ) . unwrap ( ) ;
9
- let auth = Authenticator :: new ( & config) ;
9
+ let auth = Authenticator :: new ( & config) ? ;
10
10
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 ( ) ) ;
12
12
13
13
let _ = bundle_poller. check_bundle_cache ( ) . await ?;
14
14
You can’t perform that action at this time.
0 commit comments