Skip to content

Commit 16b94f6

Browse files
committed
Fix for rubocop error
1 parent 222d303 commit 16b94f6

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

lib/line/bot/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def revoke_channel_token(access_token)
115115
# @param jwt [String]
116116
#
117117
# @return [Net::HTTPResponse]
118-
def issue_channel_access_token_21(jwt)
118+
def issue_channel_access_token_jwt(jwt)
119119
channel_id_required
120120
channel_secret_required
121121

@@ -134,7 +134,7 @@ def issue_channel_access_token_21(jwt)
134134
# @param access_token [String]
135135
#
136136
# @return [Net::HTTPResponse]
137-
def revoke_channel_access_token_21(access_token)
137+
def revoke_channel_access_token_jwt(access_token)
138138
channel_id_required
139139
channel_secret_required
140140

@@ -153,7 +153,7 @@ def revoke_channel_access_token_21(access_token)
153153
# @param jwt [String]
154154
#
155155
# @return [Net::HTTPResponse]
156-
def get_channel_access_token_key_ids_21(jwt)
156+
def get_channel_access_token_key_ids_jwt(jwt)
157157
channel_id_required
158158
channel_secret_required
159159

spec/line/bot/client_channel_token_spec.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
EOS
1212

13-
ISSUE_CHANNEL_ACCESS_TOKEN_21_CONTENT = <<"EOS"
13+
ISSUE_CHANNEL_ACCESS_TOKEN_JWT_CONTENT = <<"EOS"
1414
{
1515
"access_token": "eyJhbGciOiJIUzxxxxxx",
1616
"token_type": "Bearer",
@@ -19,7 +19,7 @@
1919
}
2020
EOS
2121

22-
GET_CHANNEL_ACCESS_TOKEN_KEY_IDS_21_CONTENT = <<"EOS"
22+
GET_CHANNEL_ACCESS_TOKEN_KEY_IDS_JWT_CONTENT = <<"EOS"
2323
{
2424
"key_ids": [
2525
"U_gdnFYKTWRxxxxDVZexGg",
@@ -74,10 +74,10 @@ def generate_client
7474

7575
it 'issues an oauth access token v2.1' do
7676
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_OAUTH_ENDPOINT + '/oauth2/v2.1/token'
77-
stub_request(:post, uri_template).to_return { |request| {body: ISSUE_CHANNEL_ACCESS_TOKEN_21_CONTENT, status: 200} }
77+
stub_request(:post, uri_template).to_return { |request| {body: ISSUE_CHANNEL_ACCESS_TOKEN_JWT_CONTENT, status: 200} }
7878

7979
client = generate_client
80-
response = client.issue_channel_access_token_21('jwt_string')
80+
response = client.issue_channel_access_token_jwt('jwt_string')
8181

8282
expect(response).to be_a(Net::HTTPOK)
8383
result = JSON.parse(response.body)
@@ -93,18 +93,19 @@ def generate_client
9393

9494
client = generate_client
9595

96-
response = client.revoke_channel_access_token_21('sDTOzw5wIfxxxxPEzcmeQA')
96+
response = client.revoke_channel_access_token_jwt('sDTOzw5wIfxxxxPEzcmeQA')
9797

9898
expect(response).to be_a(Net::HTTPOK)
9999
end
100100

101101
it 'get all valid channel access token key ids v2.1' do
102-
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_OAUTH_ENDPOINT + "/oauth2/v2.1/tokens/kid?client_assertion=jwt_string&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
103-
stub_request(:any, uri_template).to_return { |request| {body: GET_CHANNEL_ACCESS_TOKEN_KEY_IDS_21_CONTENT, status: 200} }
102+
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_OAUTH_ENDPOINT +
103+
"/oauth2/v2.1/tokens/kid?client_assertion=jwt_string&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
104+
stub_request(:any, uri_template).to_return { |request| {body: GET_CHANNEL_ACCESS_TOKEN_KEY_IDS_JWT_CONTENT, status: 200} }
104105

105106
client = generate_client
106107

107-
response = client.get_channel_access_token_key_ids_21('jwt_string')
108+
response = client.get_channel_access_token_key_ids_jwt('jwt_string')
108109

109110
expect(response).to be_a(Net::HTTPOK)
110111
end

0 commit comments

Comments
 (0)