authlete 1.38.0 → 1.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +5 -5
  2. data/authlete.gemspec +1 -2
  3. data/lib/authlete/model/service.rb +7 -1
  4. data/lib/authlete/version.rb +1 -1
  5. metadata +7 -170
  6. data/test/authlete/model/request/test_authentication-callback-request.rb +0 -100
  7. data/test/authlete/model/request/test_authorization-fail-request.rb +0 -67
  8. data/test/authlete/model/request/test_authorization-issue-request.rb +0 -94
  9. data/test/authlete/model/request/test_authorization-request.rb +0 -57
  10. data/test/authlete/model/request/test_backchannel-authentication-complete-request.rb +0 -102
  11. data/test/authlete/model/request/test_backchannel-authentication-fail-request.rb +0 -71
  12. data/test/authlete/model/request/test_backchannel-authentication-issue-request.rb +0 -57
  13. data/test/authlete/model/request/test_backchannel-authentication-request.rb +0 -75
  14. data/test/authlete/model/request/test_client-authorization-delete-request.rb +0 -57
  15. data/test/authlete/model/request/test_client-authorization-get-list-request.rb +0 -71
  16. data/test/authlete/model/request/test_client-authorization-update-request.rb +0 -63
  17. data/test/authlete/model/request/test_client-registration-request.rb +0 -68
  18. data/test/authlete/model/request/test_device-authorization-request.rb +0 -75
  19. data/test/authlete/model/request/test_device-complete-request.rb +0 -102
  20. data/test/authlete/model/request/test_device-verification-request.rb +0 -57
  21. data/test/authlete/model/request/test_granted-scopes-request.rb +0 -57
  22. data/test/authlete/model/request/test_introspection-request.rb +0 -79
  23. data/test/authlete/model/request/test_pushed-auth-req-request.rb +0 -75
  24. data/test/authlete/model/request/test_revocation-request.rb +0 -67
  25. data/test/authlete/model/request/test_standard-introspection-request.rb +0 -57
  26. data/test/authlete/model/request/test_token-create-request.rb +0 -110
  27. data/test/authlete/model/request/test_token-fail-request.rb +0 -63
  28. data/test/authlete/model/request/test_token-issue-request.rb +0 -70
  29. data/test/authlete/model/request/test_token-request.rb +0 -94
  30. data/test/authlete/model/request/test_token-revoke-request.rb +0 -71
  31. data/test/authlete/model/request/test_token-update-request.rb +0 -82
  32. data/test/authlete/model/request/test_user-info-issue-request.rb +0 -67
  33. data/test/authlete/model/request/test_user-info-request.rb +0 -75
  34. data/test/authlete/model/response/test_access-token.rb +0 -101
  35. data/test/authlete/model/response/test_authorization-fail-response.rb +0 -68
  36. data/test/authlete/model/response/test_authorization-issue-response.rb +0 -92
  37. data/test/authlete/model/response/test_authorization-response.rb +0 -145
  38. data/test/authlete/model/response/test_authorized-client-list-response.rb +0 -83
  39. data/test/authlete/model/response/test_backchannel-authentication-complete-response.rb +0 -132
  40. data/test/authlete/model/response/test_backchannel-authentication-fail-response.rb +0 -68
  41. data/test/authlete/model/response/test_backchannel-authentication-issue-response.rb +0 -80
  42. data/test/authlete/model/response/test_backchannel-authentication-response.rb +0 -156
  43. data/test/authlete/model/response/test_client-list-response.rb +0 -79
  44. data/test/authlete/model/response/test_client-secret-refresh-response.rb +0 -68
  45. data/test/authlete/model/response/test_client-secret-update-response.rb +0 -68
  46. data/test/authlete/model/response/test_device-authorization-response.rb +0 -140
  47. data/test/authlete/model/response/test_device-complete-response.rb +0 -64
  48. data/test/authlete/model/response/test_device-verification-response.rb +0 -112
  49. data/test/authlete/model/response/test_granted-scopes-get-response.rb +0 -84
  50. data/test/authlete/model/response/test_introspection-response.rb +0 -127
  51. data/test/authlete/model/response/test_pushed-auth-req-response.rb +0 -76
  52. data/test/authlete/model/response/test_revocation-response.rb +0 -68
  53. data/test/authlete/model/response/test_service-list-response.rb +0 -72
  54. data/test/authlete/model/response/test_standard-introspection-response.rb +0 -68
  55. data/test/authlete/model/response/test_token-create-response.rb +0 -107
  56. data/test/authlete/model/response/test_token-fail-response.rb +0 -68
  57. data/test/authlete/model/response/test_token-issue-response.rb +0 -127
  58. data/test/authlete/model/response/test_token-list-response.rb +0 -84
  59. data/test/authlete/model/response/test_token-response.rb +0 -147
  60. data/test/authlete/model/response/test_token-revoke-response.rb +0 -63
  61. data/test/authlete/model/response/test_token-update-response.rb +0 -87
  62. data/test/authlete/model/response/test_user-info-issue-response.rb +0 -68
  63. data/test/authlete/model/response/test_user-info-response.rb +0 -107
  64. data/test/authlete/model/test_client-extension.rb +0 -98
  65. data/test/authlete/model/test_client.rb +0 -604
  66. data/test/authlete/model/test_hsk.rb +0 -108
  67. data/test/authlete/model/test_named-uri.rb +0 -83
  68. data/test/authlete/model/test_pair.rb +0 -83
  69. data/test/authlete/model/test_property.rb +0 -88
  70. data/test/authlete/model/test_result.rb +0 -68
  71. data/test/authlete/model/test_scope.rb +0 -104
  72. data/test/authlete/model/test_service-owner.rb +0 -80
  73. data/test/authlete/model/test_service.rb +0 -896
  74. data/test/authlete/model/test_sns-credentials.rb +0 -88
  75. data/test/authlete/model/test_tagged-value.rb +0 -83
  76. data/test/authlete/model/test_trust-anchor.rb +0 -84
  77. data/test/authlete/test_exception.rb +0 -70
  78. data/test/authlete/types/test_application-type.rb +0 -44
  79. data/test/authlete/types/test_client-auth-method.rb +0 -64
  80. data/test/authlete/types/test_delivery-mode.rb +0 -48
  81. data/test/authlete/types/test_grant-type.rb +0 -72
  82. data/test/authlete/types/test_jwealg.rb +0 -104
  83. data/test/authlete/types/test_jweenc.rb +0 -60
  84. data/test/authlete/types/test_jwsalg.rb +0 -96
  85. data/test/authlete/types/test_response-type.rb +0 -68
  86. data/test/authlete/types/test_subject-type.rb +0 -44
@@ -1,102 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class BackchannelAuthenticationCompleteRequestTest < Minitest::Test
23
- TICKET = '<ticket>'
24
- RESULT = 'AUTHORIZED'
25
- SUBJECT = '<subject>'
26
- SUB = '<sub>'
27
- AUTH_TIME = 100
28
- ACR = '<acr>'
29
- CLAIMS = [ 'claim0', 'claim1' ]
30
- PROPERTY_KEY = '<prop-key0>'
31
- PROPERTY_VALUE = '<prop-value0>'
32
- PROPERTIES = [ Authlete::Model::Property.new(key: PROPERTY_KEY, value: PROPERTY_VALUE) ]
33
- SCOPES = [ 'scope0', 'scope1' ]
34
- ERROR_DESCRIPTION = '<error-description>'
35
- ERROR_URI = '<error-uri>'
36
-
37
-
38
- def set_params(obj)
39
- obj.ticket = TICKET
40
- obj.result = RESULT
41
- obj.subject = SUBJECT
42
- obj.sub = SUB
43
- obj.auth_time = AUTH_TIME
44
- obj.acr = ACR
45
- obj.claims = CLAIMS
46
- obj.properties = PROPERTIES
47
- obj.scopes = SCOPES
48
- obj.error_description = ERROR_DESCRIPTION
49
- obj.error_uri = ERROR_URI
50
- end
51
-
52
-
53
- def match(obj)
54
- assert_equal TICKET, obj.ticket
55
- assert_equal RESULT, obj.result
56
- assert_equal SUBJECT, obj.subject
57
- assert_equal SUB, obj.sub
58
- assert_equal AUTH_TIME, obj.authTime
59
- assert_equal ACR, obj.acr
60
- assert_equal CLAIMS, obj.claims
61
- assert_equal PROPERTY_KEY, obj.properties[0].key
62
- assert_equal PROPERTY_VALUE, obj.properties[0].value
63
- assert_equal SCOPES, obj.scopes
64
- assert_equal ERROR_DESCRIPTION, obj.errorDescription
65
- assert_equal ERROR_URI, obj.errorUri
66
- end
67
-
68
-
69
- def generate_hash
70
- {
71
- ticket: '<ticket>',
72
- result: 'AUTHORIZED',
73
- subject: '<subject>',
74
- sub: '<sub>',
75
- authTime: 100,
76
- acr: '<acr>',
77
- claims: [ 'claim0', 'claim1' ],
78
- properties: [ { key: '<prop-key0>', value: '<prop-value0>', hidden: false } ],
79
- scopes: [ 'scope0', 'scope1' ],
80
- errorDescription: '<error-description>',
81
- errorUri: '<error-uri>'
82
- }
83
- end
84
-
85
-
86
- def test_setters
87
- actual = Authlete::Model::Request::BackchannelAuthenticationCompleteRequest.new
88
- set_params(actual)
89
-
90
- match(actual)
91
- end
92
-
93
-
94
- def test_to_hash
95
- obj = Authlete::Model::Request::BackchannelAuthenticationCompleteRequest.new
96
- set_params(obj)
97
- actual = obj.to_hash
98
- expected = generate_hash
99
-
100
- assert_equal expected, actual
101
- end
102
- end
@@ -1,71 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class BackchannelAuthenticationFailRequestTest < Minitest::Test
23
- TICKET = '<ticket>'
24
- REASON = 'ACCESS_DENIED'
25
- ERROR_DESCRIPTION = '<error-description>'
26
- ERROR_URI = '<error-uri>'
27
-
28
-
29
- def set_params(obj)
30
- obj.ticket = TICKET
31
- obj.reason = REASON
32
- obj.error_description = ERROR_DESCRIPTION
33
- obj.error_uri = ERROR_URI
34
- end
35
-
36
-
37
- def match(obj)
38
- assert_equal TICKET, obj.ticket
39
- assert_equal REASON, obj.reason
40
- assert_equal ERROR_DESCRIPTION, obj.errorDescription
41
- assert_equal ERROR_URI, obj.errorUri
42
- end
43
-
44
-
45
- def generate_hash
46
- {
47
- ticket: '<ticket>',
48
- reason: 'ACCESS_DENIED',
49
- errorDescription: '<error-description>',
50
- errorUri: '<error-uri>'
51
- }
52
- end
53
-
54
-
55
- def test_setters
56
- actual = Authlete::Model::Request::BackchannelAuthenticationFailRequest.new
57
- set_params(actual)
58
-
59
- match(actual)
60
- end
61
-
62
-
63
- def test_to_hash
64
- obj = Authlete::Model::Request::BackchannelAuthenticationFailRequest.new
65
- set_params(obj)
66
- actual = obj.to_hash
67
- expected = generate_hash
68
-
69
- assert_equal expected, actual
70
- end
71
- end
@@ -1,57 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class BackchannelAuthenticationIssueRequestTest < Minitest::Test
23
- TICKET = '<ticket>'
24
-
25
-
26
- def set_params(obj)
27
- obj.ticket = TICKET
28
- end
29
-
30
-
31
- def match(obj)
32
- assert_equal TICKET, obj.ticket
33
- end
34
-
35
-
36
- def generate_hash
37
- { ticket: '<ticket>' }
38
- end
39
-
40
-
41
- def test_setters
42
- actual = Authlete::Model::Request::BackchannelAuthenticationIssueRequest.new
43
- set_params(actual)
44
-
45
- match(actual)
46
- end
47
-
48
-
49
- def test_to_hash
50
- obj = Authlete::Model::Request::BackchannelAuthenticationIssueRequest.new
51
- set_params(obj)
52
- actual = obj.to_hash
53
- expected = generate_hash
54
-
55
- assert_equal expected, actual
56
- end
57
- end
@@ -1,75 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class BackchannelAuthenticationRequestTest < Minitest::Test
23
- PARAMETERS = '<parameters>'
24
- CLIENT_ID = '<client-id>'
25
- CLIENT_SECRET = '<client-secret>'
26
- CLIENT_CERTIFICATE = '<client-certificate>'
27
- CLIENT_CERTIFICATE_PATH = [ 'path0', 'path1' ]
28
-
29
-
30
- def set_params(obj)
31
- obj.parameters = PARAMETERS
32
- obj.client_id = CLIENT_ID
33
- obj.client_secret = CLIENT_SECRET
34
- obj.client_certificate = CLIENT_CERTIFICATE
35
- obj.client_certificate_path = CLIENT_CERTIFICATE_PATH
36
- end
37
-
38
-
39
- def match(obj)
40
- assert_equal PARAMETERS, obj.parameters
41
- assert_equal CLIENT_ID, obj.clientId
42
- assert_equal CLIENT_SECRET, obj.clientSecret
43
- assert_equal CLIENT_CERTIFICATE, obj.clientCertificate
44
- assert_equal CLIENT_CERTIFICATE_PATH, obj.clientCertificatePath
45
- end
46
-
47
-
48
- def generate_hash
49
- {
50
- parameters: '<parameters>',
51
- clientId: '<client-id>',
52
- clientSecret: '<client-secret>',
53
- clientCertificate: '<client-certificate>',
54
- clientCertificatePath: [ 'path0', 'path1' ]
55
- }
56
- end
57
-
58
-
59
- def test_setters
60
- actual = Authlete::Model::Request::BackchannelAuthenticationRequest.new
61
- set_params(actual)
62
-
63
- match(actual)
64
- end
65
-
66
-
67
- def test_to_hash
68
- obj = Authlete::Model::Request::BackchannelAuthenticationRequest.new
69
- set_params(obj)
70
- actual = obj.to_hash
71
- expected = generate_hash
72
-
73
- assert_equal expected, actual
74
- end
75
- end
@@ -1,57 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class ClientAuthorizationDeleteRequestTest < Minitest::Test
23
- SUBJECT = '<subject>'
24
-
25
-
26
- def set_params(obj)
27
- obj.subject = SUBJECT
28
- end
29
-
30
-
31
- def match(obj)
32
- assert_equal SUBJECT, obj.subject
33
- end
34
-
35
-
36
- def generate_hash
37
- { subject: '<subject>' }
38
- end
39
-
40
-
41
- def test_setters
42
- actual = Authlete::Model::Request::ClientAuthorizationDeleteRequest.new
43
- set_params(actual)
44
-
45
- match(actual)
46
- end
47
-
48
-
49
- def test_to_hash
50
- obj = Authlete::Model::Request::ClientAuthorizationDeleteRequest.new
51
- set_params(obj)
52
- actual = obj.to_hash
53
- expected = generate_hash
54
-
55
- assert_equal expected, actual
56
- end
57
- end
@@ -1,71 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class ClientAuthorizationGetListRequestTest < Minitest::Test
23
- SUBJECT = '<subject>'
24
- DEVELOPER = '<developer>'
25
- START_PARAM = 0
26
- END_PARAM = 2
27
-
28
-
29
- def set_params(obj)
30
- obj.subject = SUBJECT
31
- obj.developer = DEVELOPER
32
- obj.start = START_PARAM
33
- obj.end = END_PARAM
34
- end
35
-
36
-
37
- def match(obj)
38
- assert_equal SUBJECT, obj.subject
39
- assert_equal DEVELOPER, obj.developer
40
- assert_equal START_PARAM, obj.start
41
- assert_equal END_PARAM, obj.end
42
- end
43
-
44
-
45
- def generate_hash
46
- {
47
- subject: '<subject>',
48
- developer: '<developer>',
49
- start: 0,
50
- end: 2
51
- }
52
- end
53
-
54
-
55
- def test_setters
56
- actual = Authlete::Model::Request::ClientAuthorizationGetListRequest.new
57
- set_params(actual)
58
-
59
- match(actual)
60
- end
61
-
62
-
63
- def test_to_hash
64
- obj = Authlete::Model::Request::ClientAuthorizationGetListRequest.new
65
- set_params(obj)
66
- actual = obj.to_hash
67
- expected = generate_hash
68
-
69
- assert_equal expected, actual
70
- end
71
- end
@@ -1,63 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class ClientAuthorizationUpdateRequestTest < Minitest::Test
23
- SUBJECT = '<subject>'
24
- SCOPES = [ 'scope0', 'scope1' ]
25
-
26
-
27
- def set_params(obj)
28
- obj.subject = SUBJECT
29
- obj.scopes = SCOPES
30
- end
31
-
32
-
33
- def match(obj)
34
- assert_equal SUBJECT, obj.subject
35
- assert_equal SCOPES, obj.scopes
36
- end
37
-
38
-
39
- def generate_hash
40
- {
41
- subject: '<subject>',
42
- scopes: [ 'scope0', 'scope1' ]
43
- }
44
- end
45
-
46
-
47
- def test_setters
48
- actual = Authlete::Model::Request::ClientAuthorizationUpdateRequest.new
49
- set_params(actual)
50
-
51
- match(actual)
52
- end
53
-
54
-
55
- def test_to_hash
56
- obj = Authlete::Model::Request::ClientAuthorizationUpdateRequest.new
57
- set_params(obj)
58
- actual = obj.to_hash
59
- expected = generate_hash
60
-
61
- assert_equal expected, actual
62
- end
63
- end
@@ -1,68 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'json'
20
- require 'minitest/autorun'
21
-
22
-
23
- class ClientRegistrationRequestTest < Minitest::Test
24
- JSON = '<json>'
25
- TOKEN = '<token>'
26
- CLIENT_ID = '<client-id>'
27
-
28
-
29
- def set_params(obj)
30
- obj.json = JSON
31
- obj.token = TOKEN
32
- obj.client_id = CLIENT_ID
33
- end
34
-
35
-
36
- def match(obj)
37
- assert_equal JSON, obj.json
38
- assert_equal TOKEN, obj.token
39
- assert_equal CLIENT_ID, obj.clientId
40
- end
41
-
42
-
43
- def generate_hash
44
- {
45
- json: '<json>',
46
- token: '<token>',
47
- clientId: '<client-id>'
48
- }
49
- end
50
-
51
-
52
- def test_setters
53
- actual = Authlete::Model::Request::ClientRegistrationRequest.new
54
- set_params(actual)
55
-
56
- match(actual)
57
- end
58
-
59
-
60
- def test_to_hash
61
- obj = Authlete::Model::Request::ClientRegistrationRequest.new
62
- set_params(obj)
63
- actual = obj.to_hash
64
- expected = generate_hash
65
-
66
- assert_equal expected, actual
67
- end
68
- end
@@ -1,75 +0,0 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2014-2020 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'authlete'
19
- require 'minitest/autorun'
20
-
21
-
22
- class DeviceAuthorizationRequestTest < Minitest::Test
23
- PARAMETERS = '<parameters>'
24
- CLIENT_ID = '<client-id>'
25
- CLIENT_SECRET = '<client-secret>'
26
- CLIENT_CERTIFICATE = '<client-certificate>'
27
- CLIENT_CERTIFICATE_PATH = [ 'path0', 'path1' ]
28
-
29
-
30
- def set_params(obj)
31
- obj.parameters = PARAMETERS
32
- obj.client_id = CLIENT_ID
33
- obj.client_secret = CLIENT_SECRET
34
- obj.client_certificate = CLIENT_CERTIFICATE
35
- obj.client_certificate_path = CLIENT_CERTIFICATE_PATH
36
- end
37
-
38
-
39
- def match(obj)
40
- assert_equal PARAMETERS, obj.parameters
41
- assert_equal CLIENT_ID, obj.clientId
42
- assert_equal CLIENT_SECRET, obj.clientSecret
43
- assert_equal CLIENT_CERTIFICATE, obj.clientCertificate
44
- assert_equal CLIENT_CERTIFICATE_PATH, obj.clientCertificatePath
45
- end
46
-
47
-
48
- def generate_hash
49
- {
50
- parameters: '<parameters>',
51
- clientId: '<client-id>',
52
- clientSecret: '<client-secret>',
53
- clientCertificate: '<client-certificate>',
54
- clientCertificatePath: [ 'path0', 'path1' ]
55
- }
56
- end
57
-
58
-
59
- def test_setters
60
- actual = Authlete::Model::Request::DeviceAuthorizationRequest.new
61
- set_params(actual)
62
-
63
- match(actual)
64
- end
65
-
66
-
67
- def test_to_hash
68
- obj = Authlete::Model::Request::DeviceAuthorizationRequest.new
69
- set_params(obj)
70
- actual = obj.to_hash
71
- expected = generate_hash
72
-
73
- assert_equal expected, actual
74
- end
75
- end