You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let no_auth_req = Request::builder().body(Body::empty()).expect("should never fail!");
117
+
let no_auth_req = Request::builder()
118
+
.body(Body::empty())
119
+
.expect("should never fail!");
117
120
118
121
let(dummy_adapter, redis) = setup().await;
119
-
let no_auth = for_request(no_auth_req,&dummy_adapter, redis.clone()).await
122
+
let no_auth = for_request(no_auth_req,&dummy_adapter, redis.clone())
123
+
.await
120
124
.expect("Handling the Request shouldn't have failed");
121
125
122
-
assert!(no_auth.extensions().get::<Session>().is_none(),"There shouldn't be a Session in the extensions");
123
-
assert_eq!(Some(dummy_adapter.whoami()), no_auth.extensions().get::<ValidatorId>(),"There should be the whoami() ValidatorId of the adapter in the extensions");
126
+
assert!(
127
+
no_auth.extensions().get::<Session>().is_none(),
128
+
"There shouldn't be a Session in the extensions"
129
+
);
130
+
assert_eq!(
131
+
Some(dummy_adapter.whoami()),
132
+
no_auth.extensions().get::<ValidatorId>(),
133
+
"There should be the whoami() ValidatorId of the adapter in the extensions"
134
+
);
124
135
125
136
// there is a Header, but it has wrong format
126
-
let incorrect_auth_req = Request::builder().header(AUTHORIZATION,"Wrong Header").body(Body::empty()).unwrap();
127
-
let incorrect_auth = for_request(incorrect_auth_req,&dummy_adapter, redis.clone()).await
137
+
let incorrect_auth_req = Request::builder()
138
+
.header(AUTHORIZATION,"Wrong Header")
139
+
.body(Body::empty())
140
+
.unwrap();
141
+
let incorrect_auth = for_request(incorrect_auth_req,&dummy_adapter, redis.clone())
142
+
.await
128
143
.expect("Handling the Request shouldn't have failed");
129
-
assert!(incorrect_auth.extensions().get::<Session>().is_none(),"There shouldn't be a Session in the extensions");
0 commit comments