feat(llc): Deprecate location in favor of edge server.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2022-01-17 18:55:17 +05:30
committed by xsahil03x
parent 512d68af63
commit c0ae7a8768
4 changed files with 13 additions and 49 deletions
@@ -5,8 +5,7 @@ import 'package:test/test.dart';
void main() {
test('should return the all default set params', () {
const options = StreamHttpClientOptions();
expect(options.location, isNull);
expect(options.baseUrl, 'https://chat-us-east-1.stream-io-api.com');
expect(options.baseUrl, 'https://chat.stream-io-api.com');
expect(options.connectTimeout, const Duration(seconds: 6));
expect(options.receiveTimeout, const Duration(seconds: 6));
expect(options.queryParameters, const {});
@@ -21,39 +20,10 @@ void main() {
headers: {'test': 'test'},
queryParameters: {'123': '123'},
);
expect(options.location, isNull);
expect(options.baseUrl, 'base-url');
expect(options.connectTimeout, const Duration(seconds: 3));
expect(options.receiveTimeout, const Duration(seconds: 3));
expect(options.headers, {'test': 'test'});
expect(options.queryParameters, {'123': '123'});
});
group('should create baseUrl according to provided location', () {
test('us-east', () {
const options = StreamHttpClientOptions(location: Location.usEast);
expect(options.location, isNotNull);
expect(options.baseUrl, 'https://chat-proxy-us-east.stream-io-api.com');
});
test('eu-west', () {
const options = StreamHttpClientOptions(location: Location.euWest);
expect(options.location, isNotNull);
expect(options.baseUrl, 'https://chat-proxy-dublin.stream-io-api.com');
});
test('mumbai', () {
const options = StreamHttpClientOptions(location: Location.mumbai);
expect(options.location, isNotNull);
expect(options.baseUrl, 'https://chat-proxy-mumbai.stream-io-api.com');
});
test('sydney', () {
const options = StreamHttpClientOptions(location: Location.sydney);
expect(options.location, isNotNull);
expect(options.baseUrl, 'https://chat-proxy-sydney.stream-io-api.com');
});
test('singapore', () {
const options = StreamHttpClientOptions(location: Location.singapore);
expect(options.location, isNotNull);
expect(options.baseUrl, 'https://chat-proxy-singapore.stream-io-api.com');
});
});
}