[LLC] Deprecate setUser with connectUser

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-03 15:47:29 +05:30
parent ceb7cc0bdb
commit 3e43ba6dc7
6 changed files with 48 additions and 25 deletions
@@ -3496,10 +3496,10 @@ void main() {
expect(response.users, isA<Map<String, User>>());
});
test('SetGuestUserResponse', () {
test('ConnectGuestUserResponse', () {
const jsonExample =
r'{"user":{"id":"guest-ac612aee-25fe-49fb-b1af-969e41f452a0-wild-breeze-7","role":"guest","created_at":"2020-02-03T10:19:01.538434Z","updated_at":"2020-02-03T10:19:01.539543Z","banned":false,"online":false},"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZ3Vlc3QtYWM2MTJhZWUtMjVmZS00OWZiLWIxYWYtOTY5ZTQxZjQ1MmEwLXdpbGQtYnJlZXplLTcifQ.mmoFGu7oJjpFsp7nFN78UbIpO7gowbuIbyoppsuvbXA","duration":"4.66ms"}';
final response = SetGuestUserResponse.fromJson(json.decode(jsonExample));
final response = ConnectGuestUserResponse.fromJson(json.decode(jsonExample));
expect(response.user, isA<User>());
expect(response.accessToken, isA<String>());
});
@@ -390,7 +390,7 @@ void main() {
});
group('user', () {
test('setUser should throw exception', () async {
test('connectUser should throw exception', () async {
final mockDio = MockDio();
when(mockDio.options).thenReturn(BaseOptions());
@@ -422,7 +422,7 @@ void main() {
httpClient: mockDio,
);
expect(() => client.setUserWithProvider(User(id: 'test-id')),
expect(() => client.connectUserWithProvider(User(id: 'test-id')),
throwsA(isA<Exception>()));
});