22A WillowAuth0DemoTest is a test class for testing the behavior of WillowAuth0Demo
33"
44Class {
5- #name : # WillowAuth0DemoTest ,
6- #superclass : # BWRenderingTest ,
5+ #name : ' WillowAuth0DemoTest' ,
6+ #superclass : ' BWRenderingTest' ,
77 #instVars : [
88 ' session'
99 ],
10- #category : #' Willow-Auth0-Demo-Tests'
10+ #category : ' Willow-Auth0-Demo-Tests' ,
11+ #package : ' Willow-Auth0-Demo-Tests'
1112}
1213
13- { #category : # running }
14+ { #category : ' running' }
1415WillowAuth0DemoTest >> configuration [
1516
1617 ^ NeoJSONObject new
@@ -24,7 +25,7 @@ WillowAuth0DemoTest >> configuration [
2425 yourself
2526]
2627
27- { #category : # running }
28+ { #category : ' running' }
2829WillowAuth0DemoTest >> createHandlers [
2930
3031 | registry |
@@ -43,19 +44,19 @@ WillowAuth0DemoTest >> createHandlers [
4344 ^ Array with: registry with: session
4445]
4546
46- { #category : # running }
47+ { #category : ' running' }
4748WillowAuth0DemoTest >> performTest [
4849
4950 CurrentApplicationConfiguration value: self configuration during: [ super performTest ]
5051]
5152
52- { #category : # tests }
53+ { #category : ' tests' }
5354WillowAuth0DemoTest >> testApplicationTitle [
5455
5556 self assert: WillowAuth0Demo applicationTitle equals: ' Willow Auth0 - Demo Application'
5657]
5758
58- { #category : # tests }
59+ { #category : ' tests' }
5960WillowAuth0DemoTest >> testInitialRequest [
6061
6162 | response |
@@ -65,21 +66,21 @@ WillowAuth0DemoTest >> testInitialRequest [
6566 self assert: response status equals: 403
6667]
6768
68- { #category : # tests }
69+ { #category : ' tests' }
6970WillowAuth0DemoTest >> testJQueryLibrary [
7071
7172 self assert: ( WillowAuth0Demo new jQueryLibrary isA: JQuery3OnlineLibrary )
7273]
7374
74- { #category : # tests }
75+ { #category : ' tests' }
7576WillowAuth0DemoTest >> testJsonWebTokenSignatureAlgorithm [
7677
7778 self
7879 assert: WillowAuth0Demo jsonWebTokenSignatureAlgorithm
7980 equals: ( JsonWebAlgorithm named: ' HS256' )
8081]
8182
82- { #category : # tests }
83+ { #category : ' tests' }
8384WillowAuth0DemoTest >> testLogoutFromAuth0 [
8485
8586 | response redirectLocation |
@@ -102,7 +103,7 @@ WillowAuth0DemoTest >> testLogoutFromAuth0 [
102103 assert: ( redirectLocation queryFields at: ' returnTo' ) equals: WillowAuth0Demo logoutReturnUrl
103104]
104105
105- { #category : # tests }
106+ { #category : ' tests' }
106107WillowAuth0DemoTest >> testMaterializeAndCheckSignatureOfJsonWebToken [
107108
108109 | token |
@@ -113,23 +114,23 @@ WillowAuth0DemoTest >> testMaterializeAndCheckSignatureOfJsonWebToken [
113114 ( JWTClaimsSet new
114115 sub: ' auth0|123456789' ;
115116 yourself );
116- key : ' secret' ;
117+ privateKey : ' secret' ;
117118 compactSerialized.
118119
119120 self
120121 assert: ( WillowAuth0Demo materializeAndCheckSignatureOfJsonWebToken: token ) payload subject
121122 equals: ' auth0|123456789'
122123]
123124
124- { #category : # tests }
125+ { #category : ' tests' }
125126WillowAuth0DemoTest >> testMaterializeAndCheckSignatureOfJsonWebTokenWithInvalidKey [
126127
127128 | token |
128129
129130 token := JsonWebSignature new
130131 algorithmName: ' HS256' ;
131132 payload: JWTClaimsSet new ;
132- key : ' fake-secret' ;
133+ privateKey : ' fake-secret' ;
133134 compactSerialized.
134135
135136 self
@@ -138,7 +139,7 @@ WillowAuth0DemoTest >> testMaterializeAndCheckSignatureOfJsonWebTokenWithInvalid
138139 withMessageText: ' signature does not match'
139140]
140141
141- { #category : # tests }
142+ { #category : ' tests' }
142143WillowAuth0DemoTest >> testRegistration [
143144
144145 self should: [ WADispatcher default handlerAt: WillowAuth0Demo handlerName ] raise: WAError .
@@ -149,7 +150,7 @@ WillowAuth0DemoTest >> testRegistration [
149150 ensure : [ WillowAuth0Demo unregisterFromApplications ]
150151]
151152
152- { #category : # tests }
153+ { #category : ' tests' }
153154WillowAuth0DemoTest >> testRenderContentOn [
154155
155156 | application html |
0 commit comments