@@ -26,8 +26,10 @@ void main() {
2626
2727 test ('oauth_chopper returns interceptor which contains oauth_chopper' , () {
2828 // arrange
29- final oauthChopper =
30- OAuthChopper (authorizationEndpoint: Uri .parse ('endpoint' ), identifier: 'identifier' , secret: 'secret' );
29+ final oauthChopper = OAuthChopper (
30+ authorizationEndpoint: Uri .parse ('endpoint' ),
31+ identifier: 'identifier' ,
32+ secret: 'secret' );
3133
3234 // act
3335 final inteceptor = oauthChopper.interceptor;
@@ -38,8 +40,10 @@ void main() {
3840
3941 test ('oauth_chopper returns authenticator which contains oauth_chopper' , () {
4042 // arrange
41- final oauthChopper =
42- OAuthChopper (authorizationEndpoint: Uri .parse ('endpoint' ), identifier: 'identifier' , secret: 'secret' );
43+ final oauthChopper = OAuthChopper (
44+ authorizationEndpoint: Uri .parse ('endpoint' ),
45+ identifier: 'identifier' ,
46+ secret: 'secret' );
4347
4448 // act
4549 final authenticator = oauthChopper.authenticator ();
@@ -52,7 +56,10 @@ void main() {
5256 // arrange
5357 when (() => storageMock.fetchCredentials ()).thenAnswer ((_) => testJson);
5458 final oauthChopper = OAuthChopper (
55- authorizationEndpoint: Uri .parse ('endpoint' ), identifier: 'identifier' , secret: 'secret' , storage: storageMock);
59+ authorizationEndpoint: Uri .parse ('endpoint' ),
60+ identifier: 'identifier' ,
61+ secret: 'secret' ,
62+ storage: storageMock);
5663
5764 // act
5865 final token = await oauthChopper.token;
@@ -67,7 +74,10 @@ void main() {
6774 // arrange
6875 when (() => storageMock.fetchCredentials ()).thenAnswer ((_) => null );
6976 final oauthChopper = OAuthChopper (
70- authorizationEndpoint: Uri .parse ('endpoint' ), identifier: 'identifier' , secret: 'secret' , storage: storageMock);
77+ authorizationEndpoint: Uri .parse ('endpoint' ),
78+ identifier: 'identifier' ,
79+ secret: 'secret' ,
80+ storage: storageMock);
7181
7282 // act
7383 final token = await oauthChopper.token;
@@ -79,9 +89,13 @@ void main() {
7989 test ("Successful grant is stored" , () async {
8090 // arrange
8191 when (() => storageMock.saveCredentials (any ())).thenAnswer ((_) => null );
82- when (() => grantMock.handle (any (), any (), any ())).thenAnswer ((_) async => testJson);
92+ when (() => grantMock.handle (any (), any (), any ()))
93+ .thenAnswer ((_) async => testJson);
8394 final oauthChopper = OAuthChopper (
84- authorizationEndpoint: Uri .parse ('endpoint' ), identifier: 'identifier' , secret: 'secret' , storage: storageMock);
95+ authorizationEndpoint: Uri .parse ('endpoint' ),
96+ identifier: 'identifier' ,
97+ secret: 'secret' ,
98+ storage: storageMock);
8599
86100 // act
87101 final token = await oauthChopper.requestGrant (grantMock);
@@ -90,7 +104,7 @@ void main() {
90104 verify (() => grantMock.handle (any (), 'identifier' , 'secret' )).called (1 );
91105 verify (() => storageMock.saveCredentials (testJson)).called (1 );
92106 expect (token.accessToken, 'accesToken' );
93- expect (token? .idToken, 'idToken' );
107+ expect (token.idToken, 'idToken' );
94108 expect (token.refreshToken, 'refreshToken' );
95109 });
96110}
0 commit comments