Skip to content

Commit f61cd60

Browse files
zecakehbnjbvr
authored andcommitted
refactor(oauth): Change the Oauth prefix in test utils with OAuth
For consistency. Signed-off-by: Kévin Commaille <[email protected]>
1 parent b9c970d commit f61cd60

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

crates/matrix-sdk/src/test_utils/client.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ impl MockClientBuilder {
5353
/// The client is registered with the OAuth 2.0 API.
5454
#[cfg(feature = "experimental-oidc")]
5555
pub fn registered_with_oauth(mut self, issuer: impl Into<String>) -> Self {
56-
self.auth_state = AuthState::RegisteredWithOauth { issuer: issuer.into() };
56+
self.auth_state = AuthState::RegisteredWithOAuth { issuer: issuer.into() };
5757
self
5858
}
5959

6060
/// The user is already logged in with the OAuth 2.0 API.
6161
#[cfg(feature = "experimental-oidc")]
6262
pub fn logged_in_with_oauth(mut self, issuer: impl Into<String>) -> Self {
63-
self.auth_state = AuthState::LoggedInWithOauth { issuer: issuer.into() };
63+
self.auth_state = AuthState::LoggedInWithOAuth { issuer: issuer.into() };
6464
self
6565
}
6666

@@ -102,10 +102,10 @@ enum AuthState {
102102
LoggedInWithMatrixAuth,
103103
/// The client is registered with the OAuth 2.0 API.
104104
#[cfg(feature = "experimental-oidc")]
105-
RegisteredWithOauth { issuer: String },
105+
RegisteredWithOAuth { issuer: String },
106106
/// The client is logged in with the OAuth 2.0 API.
107107
#[cfg(feature = "experimental-oidc")]
108-
LoggedInWithOauth { issuer: String },
108+
LoggedInWithOAuth { issuer: String },
109109
}
110110

111111
impl AuthState {
@@ -118,12 +118,12 @@ impl AuthState {
118118
client.matrix_auth().restore_session(mock_matrix_session()).await.unwrap();
119119
}
120120
#[cfg(feature = "experimental-oidc")]
121-
AuthState::RegisteredWithOauth { issuer } => {
121+
AuthState::RegisteredWithOAuth { issuer } => {
122122
let issuer = url::Url::parse(&issuer).unwrap();
123123
client.oauth().restore_registered_client(issuer, oauth::mock_client_id());
124124
}
125125
#[cfg(feature = "experimental-oidc")]
126-
AuthState::LoggedInWithOauth { issuer } => {
126+
AuthState::LoggedInWithOAuth { issuer } => {
127127
client
128128
.oauth()
129129
.restore_session(oauth::mock_session(

crates/matrix-sdk/src/test_utils/mocks/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ impl MatrixMockServer {
147147
&self.server
148148
}
149149

150-
/// Get an `OauthMockServer` that uses the same mock server as this one.
150+
/// Get an `OAuthMockServer` that uses the same mock server as this one.
151151
#[cfg(feature = "experimental-oidc")]
152-
pub fn oauth(&self) -> oauth::OauthMockServer<'_> {
153-
oauth::OauthMockServer::new(self)
152+
pub fn oauth(&self) -> oauth::OAuthMockServer<'_> {
153+
oauth::OAuthMockServer::new(self)
154154
}
155155

156156
/// Mock the given endpoint.

crates/matrix-sdk/src/test_utils/mocks/oauth.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ use super::{MatrixMock, MatrixMockServer, MockEndpoint};
5353
/// mostly defers its implementations to [`wiremock::Mock`] under the hood.
5454
///
5555
/// [`MockServer`]: wiremock::MockServer
56-
pub struct OauthMockServer<'a> {
56+
pub struct OAuthMockServer<'a> {
5757
server: &'a MatrixMockServer,
5858
}
5959

60-
impl<'a> OauthMockServer<'a> {
60+
impl<'a> OAuthMockServer<'a> {
6161
pub(super) fn new(server: &'a MatrixMockServer) -> Self {
6262
Self { server }
6363
}
@@ -69,11 +69,11 @@ impl<'a> OauthMockServer<'a> {
6969
}
7070

7171
// Specific mount endpoints.
72-
impl OauthMockServer<'_> {
72+
impl OAuthMockServer<'_> {
7373
/// Creates a prebuilt mock for the Matrix endpoint used to query the
7474
/// authorization server's metadata.
7575
///
76-
/// Contrary to all the other endpoints of [`OauthMockServer`], this is an
76+
/// Contrary to all the other endpoints of [`OAuthMockServer`], this is an
7777
/// endpoint from the Matrix API, but it is only used in the context of the
7878
/// OAuth 2.0 API, which is why it is mocked here rather than on
7979
/// [`MatrixMockServer`].

0 commit comments

Comments
 (0)